SDKs
Agent Control provides official SDKs for Python and TypeScript.| SDK | Install | Docs |
|---|---|---|
| Python | pip install agent-control-sdk | Python SDK |
| TypeScript | npm install agent-control | TypeScript SDK |
SDK development
The SDK source lives in a uv workspace. To work with the SDKs locally:Concepts (Reference)
A Control is a single rule that defines what to check and what to do when a condition is met.| Stage | When | Use Case |
|---|---|---|
pre | Before execution | Block bad inputs, prevent prompt injection |
post | After execution | Filter bad outputs, redact PII |
| Path | Description | Example Use |
|---|---|---|
input | Step input (tool args or LLM input) | Check for prompt injection |
output | Step output | Check for PII leakage |
input.query | Tool input field | Block SQL injection |
name | Step name (tool name or model/chain id) | Restrict step usage |
context.user_id | Context field | User-based rules |
* | Entire step | Full payload analysis |
| Action | Behavior |
|---|---|
deny | Block the request/response, raise ControlViolationError |
steer | Raise ControlSteerError with steering context for correction and retry |
allow | Permit execution (no effect if a deny control also matches) |
warn | Log a warning but allow execution |
log | Silent logging for monitoring only |
-
Deny wins — if any
denycontrol matches, execution is blocked. -
Steer second — if any
steercontrol matches (and no deny), steering context is returned. - Allow/warn/log — observability actions that do not block execution.
Server API
The Agent Control server exposes a RESTful API for managing agents and controls.Base URL
Default:http://localhost:8000/api/v1
Endpoints
Agents:| Method | Endpoint | Description |
|---|---|---|
GET | /agents | List all agents |
POST | /agents/initAgent | Register a new agent |
GET | /agents/{agent_name} | Get agent details |
PATCH | /agents/{agent_name} | Update agent |
GET | /agents/{agent_name}/controls | List controls for agent |
POST | /agents/{agent_name}/controls/{control_id} | Add control to agent |
DELETE | /agents/{agent_name}/controls/{control_id} | Remove control from agent |
| Method | Endpoint | Description |
|---|---|---|
PUT | /controls | Create control |
GET | /controls | List controls |
GET | /controls/{control_id} | Get control |
PATCH | /controls/{control_id} | Update control |
DELETE | /controls/{control_id} | Delete control |
| Method | Endpoint | Description |
|---|---|---|
GET | /health | Health check (no auth required) |
Authentication
Agent Control supports API key authentication for production deployments.Configuration
Authentication is controlled by environment variables:| Variable | Default | Description |
|---|---|---|
AGENT_CONTROL_API_KEY_ENABLED | false | Master toggle for authentication |
AGENT_CONTROL_API_KEYS | — | Comma-separated list of valid API keys |
AGENT_CONTROL_ADMIN_API_KEYS | — | Comma-separated list of admin API keys |
Usage
Include the API key in theX-API-Key header:
Access Levels
| Endpoint | Required Level |
|---|---|
/health | Public (no auth) |
All /api/v1/* | API key required |
Key Rotation
Agent Control supports multiple API keys for zero-downtime rotation:-
Add new key to
AGENT_CONTROL_API_KEYS(e.g.,key1,key2,new-key) - Deploy the server
- Update clients to use the new key
- Remove the old key from the variable
- Redeploy
Configuration Reference
See Configuration for full environment variables, server settings, and database setup.Troubleshooting
Server connection issues
Import errors
Authentication errors
If you get 401 Unauthorized:-
Check if auth is enabled:
AGENT_CONTROL_API_KEY_ENABLED -
Verify your API key is in
AGENT_CONTROL_API_KEYS -
Ensure the
X-API-Keyheader is set correctly
Database connection issues
Control not triggering
- Verify the control is enabled
-
Check
scope.step_typesmatches your step type (llmvstool) -
Check
scope.stagesis correct (prefor input,postfor output) - Verify the selector path matches your data structure
- Test the evaluator pattern/values independently
Luna-2 evaluator errors
-
Ensure the Galileo package is installed:
pip install agent-control-evaluator-galileo(orpip install agent-control-evaluators[galileo]) -
Ensure
GALILEO_API_KEYis set - Check network connectivity to Galileo API
- Verify the metric name is valid
-
Check
on_errorsetting if failures are silently allowed
galileo.luna2 doesn’t appear in list_evaluators():
- Verify the Galileo package is installed
- Check server logs for evaluator discovery messages