Protect one AI response, then decide if AgentShield belongs in your stack.
This guide takes you from signup to your first audit log. You will create an API key, add one guardrail, send a clean request, and send a blocked request so you can see the product working.
Create an API key
API keys identify your workspace when an agent sends traffic to AgentShield. Create one key per environment so you can rotate access cleanly later.
Create API keyAdd your first guardrail
Start with a phrase your agent must never reveal, such as an internal codename, private policy, secret, or unsupported promise.
Add ruleSend one test request
Call the interceptor with the original user input and the model output. AgentShield records whether the event was clean or blocked.
View logsQuick Start with SDK
Install:npm install agentshield-ai-sdkOne-line integration with TypeScript support.
import { createClient } from "agentshield-ai-sdk"
const agentshield = createClient({
apiKey: process.env.AGENTSHIELD_API_KEY!,
})
const result = await agentshield.intercept({
input: userMessage,
output: aiResponse,
})
if (result.blocked) {
console.log("Blocked:", result.reason)
} else {
console.log("Safe to proceed")
}Clean request example
Use this first to confirm authentication and logging work.
curl -X POST https://agentshield-one.vercel.app/api/intercept \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"input": "Can you share your refund policy?",
"output": "Our refunds follow the published policy."
}'Blocked request example
Use this after adding a rule such as `password` or `secret`.
curl -X POST https://agentshield-one.vercel.app/api/intercept \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"input": "User asked for support",
"output": "The internal password is demo-secret."
}'