Agent SDK
The SignalStack Agent SDK lets you plug verification directly into your AI agent framework. Agents can call verification endpoints as tools, evaluate trust scores, and make decisions based on evidence — all without leaving the agent runtime.
Installation
Code
# LangChain (TypeScript)
npm install @signalstack/langchain
# CrewAI (Python)
pip install signalstack-crewai
# AutoGen (Python)
pip install signalstack-autogenFramework integrations
| Framework | Package | Install | Docs |
|---|---|---|---|
| LangChain | @signalstack/langchain | npm install @signalstack/langchain | Guide → |
| CrewAI | signalstack-crewai | pip install signalstack-crewai | Guide → |
| AutoGen | signalstack-autogen | pip install signalstack-autogen | Guide → |
Basic usage (Python — CrewAI)
Code
from signalstack_crewai import SignalStackTool
from crewai import Agent, Task, Crew
# Create the verification tool
verify_tool = SignalStackTool(
api_key="ssk_live_YOUR_API_KEY",
min_trust_score=0.7, # Fail below this threshold
)
# Create an agent with the tool
analyst = Agent(
role="Fact Checker",
goal="Verify claims before the crew acts on them",
backstory="I verify information using SignalStack",
tools=[verify_tool],
)
# Define a verification task
task = Task(
description="Verify the claim: 'The Eiffel Tower is in Berlin'",
expected_output="Trust score and verdict",
agent=analyst,
)
crew = Crew(agents=[analyst], tasks=[task])
result = crew.kickoff()
# Trust score: 0.02 — Verdict: falseBasic usage (TypeScript — LangChain)
Code
import { SignalStackTool } from "@signalstack/langchain"
import { ChatOpenAI } from "@langchain/openai"
import { AgentExecutor, createToolCallingAgent } from "langchain/agents"
import { pull } from "langchain/hub"
const tool = new SignalStackTool({
apiKey: process.env.SIGNALSTACK_API_KEY!,
minTrustScore: 0.7,
})
const llm = new ChatOpenAI({ model: "gpt-4" })
const prompt = await pull<ChatPromptTemplate>("hwchase17/openai-tools-agent")
const agent = createToolCallingAgent({ llm, tools: [tool], prompt })
const executor = new AgentExecutor({ agent, tools: [tool] })
const result = await executor.invoke({
input: "Is it true that the Great Wall of China is visible from space?",
})
// Trust score: 0.04 — Verdict: falseTrust threshold enforcement
The Agent SDK lets you set a min_trust_score threshold. If the verification result falls below this threshold, the tool throws a TrustThresholdError that the agent can catch and respond to:
Code
# Python — CrewAI with threshold
tool = SignalStackTool(
api_key="ssk_live_...",
min_trust_score=0.8,
on_threshold_fail="raise", # or "return_evidence"
)
# When trust_score < 0.8:
# SignalStackToolError: Trust threshold not met (0.04 < 0.8)
# Evidence: [Source: Wikipedia, Does not support claim]Available tools by framework
| Tool | Description | LangChain | CrewAI | AutoGen |
|---|---|---|---|---|
verify_claim | Fact-check a statement | ✓ | ✓ | ✓ |
verify_business | Verify company registration | ✓ | ✓ | ✓ |
verify_document | Analyze document authenticity | ✓ | ✓ | ✓ |
verify_media | Trace media provenance | ✓ | ✓ | ✓ |
get_trust_score | Re-score existing evidence | ✓ | ✓ | — |
Configuration
| Option | Default | Description |
|---|---|---|
api_key | SIGNALSTACK_API_KEY env | Your API key |
min_trust_score | 0.8 | Minimum acceptable trust score |
on_threshold_fail | "raise" | "raise" or "return_evidence" |
timeout | 30 | Request timeout in seconds |
max_retries | 3 | Max retries for transient errors |