anchormonitor-sdk
v0.2.0
Published
Two-way guardrails for AI agents — gate inputs, outputs, and actions
Maintainers
Readme
anchor-sdk
Two-way guardrails for AI agents — gate inputs, outputs, and actions.
Install
npm install anchor-sdkQuick start
import anchor from 'anchor-sdk'
anchor.init({
url: "https://api.anchormonitor.com",
sdkKey: "sk-...", // from your ANCHOR dashboard
agentId: "my-agent",
task: "Answer billing and order questions for Acme store",
})Customer-facing agents
// Gate user input BEFORE it reaches your agent
const input = await anchor.checkInput(userMessage)
if (!input.allowed) {
return input.blockedMessage // safe pre-written response
}
// Gate agent output BEFORE returning to the user
const output = await anchor.checkOutput(agentReply)
if (!output.allowed) return "I can't help with that."
return agentReplyInternal / workflow agents
// Gate any consequential action BEFORE it executes
const result = await anchor.checkAction("send_payment", {
amount: 5000,
vendor: "Acme Corp",
})
if (!result.allowed) throw new Error("Action blocked by ANCHOR")
if (result.escalate) {
await notifyOperator(result) // high-risk: request human approval
return
}
// Safe to proceed
await executePayment(...)Links
- Dashboard: anchormonitor.com
- Python SDK:
pip install anchor-sdk
