-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify quickstart guide #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
soumya-io
wants to merge
5
commits into
main
Choose a base branch
from
move-performance-to-concepts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+158
−119
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6846855
Move performance section to dedicated page under Concepts
soumya-io 510ec64
Remove Configuration, Components, Development, and Next Steps section…
soumya-io 3a7b436
Move authentication details from quickstart to dedicated how-to guide
soumya-io a825c77
Add UI Quickstart card to quickstart What's Next section
soumya-io b44b4e7
Merge branch 'main' into move-performance-to-concepts
soumya-io File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| title: Performance | ||
| description: Agent Control adds negligible latency to your AI agents. See benchmark results across real-world scenarios. | ||
| icon: "gauge-high" | ||
| --- | ||
|
|
||
| Agent Control is designed to stay out of your agent's critical path. The evaluation pipeline runs as a lightweight sidecar check — your agent sends a request to the Agent Control server, gets back a pass/fail decision, and continues. The entire round-trip typically completes in under 40 ms at the median, even with multiple controls active. | ||
|
|
||
| This matters because AI agents already carry the latency cost of LLM inference (often hundreds of milliseconds to seconds per call). Adding safety controls shouldn't double that budget. Agent Control's architecture ensures it doesn't: | ||
|
|
||
| - **Server-side evaluators execute in-process** — built-in evaluators (regex, list, JSON, SQL) run directly inside the Agent Control server with no external network calls, keeping evaluation time minimal. | ||
| - **Controls scale linearly** — going from 1 control to 50 controls adds roughly 27 ms to the median evaluation time. You can layer comprehensive safety coverage without compounding latency. | ||
| - **Agent initialization is fast** — registering or updating an agent with its tool steps completes in under 20 ms at the median, so cold starts and re-registrations don't stall your application. | ||
|
|
||
| ## Benchmark Results | ||
|
|
||
| The following benchmarks were run on a local development environment to give you a directional sense of Agent Control's overhead. They are not production sizing guidance — your results will vary based on hardware, network topology, and evaluator complexity. | ||
|
|
||
| | Endpoint | Scenario | RPS | p50 | p99 | | ||
| |----------|----------|-----|-----|-----| | ||
| | Agent init | Agent with 3 tool steps | 509 | 19 ms | 54 ms | | ||
| | Evaluation | 1 control, 500-char content | 437 | 36 ms | 61 ms | | ||
| | Evaluation | 10 controls, 500-char content | 349 | 35 ms | 66 ms | | ||
| | Evaluation | 50 controls, 500-char content | 199 | 63 ms | 91 ms | | ||
| | Controls refresh | 5-50 controls per agent | 273-392 | 20-27 ms | 27-61 ms | | ||
|
|
||
| ### Key takeaways | ||
|
|
||
| - **All built-in evaluators perform similarly** — regex, list, JSON, and SQL evaluators all land within 40-46 ms p50 at 1 control. Choosing the right evaluator for your use case won't introduce a latency penalty. | ||
| - **Agent init handles create and update identically** — the server uses a create-or-update operation, so there's no performance difference between first registration and subsequent updates. | ||
| - **Zero errors under load** — all scenarios completed with a 0% error rate across the full benchmark duration. | ||
|
|
||
| ### Test environment | ||
|
|
||
| Benchmarks were run on an Apple M5 with 16 GB RAM using Docker Compose (`postgres:16` + `agent-control`). Each scenario ran for 2 minutes with 5 concurrent users for latency measurements (p50, p99) and 10-20 concurrent users for throughput (RPS). RPS represents completed requests per second. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| --- | ||
| title: Enable Authentication | ||
| description: Secure your Agent Control server with API key authentication for shared and production deployments. | ||
| icon: "lock" | ||
| --- | ||
|
|
||
| Authentication is disabled by default so you can get started quickly in local development. Before sharing your server or deploying to production, enable API key authentication to protect the control plane from unauthorized access. | ||
|
|
||
| ## How It Works | ||
|
|
||
| Agent Control uses a two-tier API key model: | ||
|
|
||
| | Key type | Environment variable | What it can do | | ||
| |----------|---------------------|----------------| | ||
| | **Regular** | `AGENT_CONTROL_API_KEYS` | Register agents, evaluate controls, read controls and agents | | ||
| | **Admin** | `AGENT_CONTROL_ADMIN_API_KEYS` | Everything above **plus** create/update/delete controls and manage agent-control associations | | ||
|
|
||
| The `/health` endpoint is always public and requires no authentication. | ||
|
|
||
| <Tip> | ||
| Give your agent runtime a **regular** key. Reserve **admin** keys for setup scripts, CI pipelines, and the UI dashboard. | ||
| </Tip> | ||
|
|
||
| ## Step-by-Step Setup | ||
|
|
||
| <Steps> | ||
| <Step title="Start the server with authentication enabled"> | ||
|
|
||
| Pass the authentication environment variables when starting the server: | ||
|
|
||
| ```bash | ||
| curl -L https://raw.githubusercontent.com/agentcontrol/agent-control/refs/heads/main/docker-compose.yml \ | ||
| | AGENT_CONTROL_API_KEY_ENABLED=true \ | ||
| AGENT_CONTROL_API_KEYS="my-runtime-key" \ | ||
| AGENT_CONTROL_ADMIN_API_KEYS="my-admin-key" \ | ||
| AGENT_CONTROL_SESSION_SECRET="some-long-random-string" \ | ||
| CORS_ORIGINS="http://localhost:4000" \ | ||
| docker compose -f - up -d | ||
| ``` | ||
|
|
||
| <Warning> | ||
| Replace the placeholder key values above with strong, unique secrets before any shared or production deployment. | ||
| </Warning> | ||
|
|
||
| </Step> | ||
|
|
||
| <Step title="Pass the API key from the SDK"> | ||
|
|
||
| The SDK reads the `AGENT_CONTROL_API_KEY` environment variable by default, or you can pass it explicitly: | ||
|
|
||
| ```python | ||
| from agent_control import AgentControlClient | ||
|
|
||
| # Option 1: Environment variable (recommended) | ||
| # export AGENT_CONTROL_API_KEY="my-runtime-key" | ||
| async with AgentControlClient() as client: | ||
| await client.health_check() | ||
|
|
||
| # Option 2: Explicit constructor argument | ||
| async with AgentControlClient(api_key="my-runtime-key") as client: | ||
| await client.health_check() | ||
| ``` | ||
|
|
||
| </Step> | ||
|
|
||
| <Step title="Use an admin key for control management"> | ||
|
|
||
| Operations that modify controls or agent-control associations require an admin key. This keeps your control plane locked down even if a runtime key is compromised. | ||
|
|
||
| ```python | ||
| # setup.py — run with an admin key | ||
| async with AgentControlClient(api_key="my-admin-key") as client: | ||
| await controls.create_control(client, name="block-ssn", data={...}) | ||
| await agents.add_agent_control(client, agent_name="my-agent", control_id="...") | ||
| ``` | ||
|
|
||
| </Step> | ||
|
|
||
| <Step title="Include the key in direct API calls"> | ||
|
|
||
| If calling the REST API directly, include the key in the `X-API-Key` header: | ||
|
|
||
| ```bash | ||
| curl -H "X-API-Key: my-runtime-key" \ | ||
| http://localhost:8000/api/v1/agents | ||
| ``` | ||
|
|
||
| </Step> | ||
| </Steps> | ||
|
|
||
| ## Key Rotation | ||
|
|
||
| Agent Control accepts multiple comma-separated keys per variable, making zero-downtime rotation straightforward: | ||
|
|
||
| 1. Add the new key alongside the old one: `AGENT_CONTROL_API_KEYS="old-key,new-key"` | ||
| 2. Redeploy the server | ||
| 3. Update all clients to use the new key | ||
| 4. Remove the old key: `AGENT_CONTROL_API_KEYS="new-key"` | ||
| 5. Redeploy again | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| **401 Unauthorized** — check these in order: | ||
|
|
||
| 1. Authentication is enabled (`AGENT_CONTROL_API_KEY_ENABLED=true`) | ||
| 2. Your key is present in the correct variable (`AGENT_CONTROL_API_KEYS` for regular, `AGENT_CONTROL_ADMIN_API_KEYS` for admin operations) | ||
| 3. The `X-API-Key` header (or SDK `api_key` argument) matches exactly — no trailing whitespace or quotes | ||
|
|
||
| See the [Authentication reference](/core/reference#authentication) for the full configuration table. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we move this somewhere else too?