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-autogen

Framework integrations

FrameworkPackageInstallDocs
LangChain@signalstack/langchainnpm install @signalstack/langchainGuide →
CrewAIsignalstack-crewaipip install signalstack-crewaiGuide →
AutoGensignalstack-autogenpip install signalstack-autogenGuide →

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: false

Basic 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: false

Trust 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

ToolDescriptionLangChainCrewAIAutoGen
verify_claimFact-check a statement
verify_businessVerify company registration
verify_documentAnalyze document authenticity
verify_mediaTrace media provenance
get_trust_scoreRe-score existing evidence

Configuration

OptionDefaultDescription
api_keySIGNALSTACK_API_KEY envYour API key
min_trust_score0.8Minimum acceptable trust score
on_threshold_fail"raise""raise" or "return_evidence"
timeout30Request timeout in seconds
max_retries3Max retries for transient errors

Next steps