Policies & Security
Guard your AI agents with automated policy enforcement, kill switches, and access control.
How Policies Work
Policies are rules that govern how your AI agents operate. Each policy has a type (what it checks) and an enforcement mode (what happens on violation):
Record the violation but allow the request to proceed. Good for monitoring.
Flag the request and notify admins. The request continues but is tracked.
Reject the request entirely. The LLM call is prevented from executing.
Policies can be scoped to all agents or to specific agents by ID. Evaluation happens on trace ingestion and optionally via pre-execution checks.
Policy Types
Kill Switch
Instantly pause any agent when you detect issues. Paused agents reject all new trace submissions and LLM calls (SDK throws AgentPausedError).
Pause an Agent
# Via API
curl -X PATCH http://localhost:4000/api/agents/AGENT_ID/pause \
-H "X-API-Key: ag_prod_xxx" \
-H "Content-Type: application/json" \
-d '{"reason": "Detected harmful outputs in production"}'
# Via Dashboard: Agents → Select Agent → Settings → Pause AgentResume an Agent
curl -X PATCH http://localhost:4000/api/agents/AGENT_ID/resume \
-H "X-API-Key: ag_prod_xxx"
# Via Dashboard: Agents → Select Agent → Settings → Resume AgentHandle in Your App
// The SDK automatically checks agent status before each trace
import { AgentPausedError } from '@execlave/sdk';
try {
const response = await tracedCall('User message');
} catch (err) {
if (err instanceof AgentPausedError) {
// Show a friendly message to the user
return 'This service is temporarily unavailable for maintenance.';
}
throw err;
}Agent-to-Agent Access Grants
In multi-agent systems, control which agents can invoke other agents. Access grants define allowed actions and optional expiration.
Available Actions
executereadwritedeleteinvokequerysubscribedelegate# Grant agent-a permission to execute and read from agent-b
curl -X POST http://localhost:4000/api/agents/AGENT_A_UUID/grants \
-H "X-API-Key: ag_prod_xxx" \
-H "Content-Type: application/json" \
-d '{
"targetAgentId": "AGENT_B_UUID",
"allowedActions": ["execute", "read"],
"expiresAt": "2025-12-31T23:59:59Z"
}'
# Check authorization before an agent-to-agent call
curl -X POST http://localhost:4000/api/agents/authorize \
-H "X-API-Key: ag_prod_xxx" \
-H "Content-Type: application/json" \
-d '{
"sourceAgentId": "agent-a",
"targetAgentId": "agent-b",
"action": "execute"
}'Webhook Notifications
Get notified in real-time when policy violations or anomalies occur.
Available Events
policy.violatedagent.pausedagent.resumedtrace.anomalycost.thresholdcurl -X POST http://localhost:4000/api/webhooks \
-H "X-API-Key: ag_prod_xxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/execlave-webhook",
"events": ["policy.violated", "agent.paused"],
"secret": "whsec_your_signing_secret"
}'