Tutorial: Registering AI Agents in Console
This tutorial walks you through registering AI agents, assigning policies and spend limits, and monitoring agent activity in the Keeptrusts management console.
Use this page when
- You need to register a new AI agent and issue it an Agent ID for gateway routing.
- You want to assign per-agent policies, set spend limits, or monitor agent-specific activity.
- You are investigating an agent's behavior and need to filter events by Agent ID.
- You need to pause or disable a misbehaving agent.
Primary audience
- Primary: Platform engineers deploying autonomous AI agents that route through Keeptrusts gateways
- Secondary: Security leads who need agent-level audit trails; team leads managing agent spend budgets
Prerequisites
- A Keeptrusts account with Admin role
- At least one deployed gateway routing traffic
- Familiarity with the Keeptrusts policy model and gateway keys
Why Register Agents?
AI agents — autonomous systems that call LLM providers on behalf of your applications — need oversight just like human users. Registering agents in Keeptrusts lets you enforce per-agent policies, set spend guardrails, and trace every action back to the responsible agent.
Step 1: Navigate to the Agents Page
- Log in to the Keeptrusts console.
- Open Agents from the left navigation sidebar.
The page displays a table of registered agents with their status, assigned policies, spend usage, and last-active timestamp.
| Column | Description |
|---|---|
| Name | The agent's display name |
| Agent ID | Unique identifier used in gateway headers |
| Status | Active, Paused, or Disabled |
| Policy | Assigned policy configuration |
| Spend (30d) | Cumulative cost over the last 30 days |
| Last Active | Timestamp of the most recent request |
Step 2: Register a New Agent
- Click Create agent from the Agents page (or use the empty-state register CTA if no agents exist yet).
- Fill in the create workspace draft:
| Field | Description |
|---|---|
| Name | A descriptive label (e.g., support-bot-v2, code-review-agent) |
| Description | Purpose and ownership of this agent |
| Team | The team responsible for this agent |
| Gateway | Any gateway IDs that should route traffic for this agent |
- Select Review changes.
- Check the review summary.
- Select Confirm changes.
The console generates an Agent ID that your application must include in the x-keeptrusts-agent-id header when routing requests through the gateway.
The create workspace uses the same two-step draft → review flow as Edit agent, so operators always validate changes before a create or update request is sent.
eng-code-review-v1) to make filtering and auditing easier.Step 3: Configure Agent Policies
Policies define what an agent is allowed to do. Assign a configuration that includes the appropriate policy chain.
- Open the agent detail view by clicking the agent name.
- Select the Policies tab.
- Choose a policy configuration from the dropdown, or click Create New to build one.
- Review the policy chain summary:
- Input policies — Rules applied before the request reaches the LLM
- Output policies — Rules applied to the LLM response before returning it
- Blocked categories — Content categories that trigger an immediate block
- Click Save.
Changes take effect on the next request the agent makes through the gateway.
409 Conflict responses for previously allowed requests. Test policy changes in a staging environment first.Agent history capture, learning, memory recall, and review behavior are all controlled by the history, learning, memory, and review sections of the deployed configuration version. The agent detail Configuration tab shows the current effective runtime state as a read-only summary. To change these settings, edit the configuration and redeploy it to the agent.
Step 4: Set Spend Limits
Spend limits prevent runaway costs from misbehaving or compromised agents.
- In the agent detail view, select the Spend tab.
- Configure spend thresholds:
| Field | Description |
|---|---|
| Daily Limit | Maximum spend per calendar day (USD) |
| Monthly Limit | Maximum spend per calendar month (USD) |
| Per-Request Limit | Maximum cost for a single request (USD) |
| Action on Limit | Block (reject requests) or Alert (notify but allow) |
- Click Save.
When an agent hits a spend limit with the Block action, the gateway returns a 429 Too Many Requests response with a Retry-After header.
Step 5: Monitor Agent Activity
The activity view provides real-time visibility into what your agents are doing.
- In the agent detail view, select the Activity tab.
- Review the activity dashboard:
| Metric | Description |
|---|---|
| Requests (24h) | Total requests in the last 24 hours |
| Tokens Consumed | Input and output tokens over the selected period |
| Policy Violations | Count of blocked or escalated requests |
| Average Latency | Mean response time from upstream providers |
| Error Rate | Percentage of failed requests |
- Use the date range picker to adjust the time window.
- Click on any metric to drill down into individual events.
Step 6: Filter Events by Agent
The Events page supports agent-level filtering for investigating specific agent behavior.
- Navigate to Events from the left sidebar.
- Click Add Filter.
- Select Agent from the filter dropdown.
- Choose the agent name or paste the Agent ID.
- Click Apply.
The events table now shows only decisions made for that agent. You can combine agent filters with other criteria:
- Decision — Block, Allow, Escalate, Redact
- Policy — Which policy triggered the decision
- Model — Which LLM model was targeted
- Time Range — Narrow to a specific incident window
Step 7: Pause or Disable an Agent
If an agent is misbehaving or needs maintenance:
- Open the agent detail view.
- Click Pause to temporarily stop the agent from making requests. Paused agents receive
503 Service Unavailableresponses. - Click Disable to permanently deactivate the agent. Disabled agents receive
403 Forbiddenresponses.
To reactivate, click Resume or Enable from the same view.
Step 8: Bulk Agent Operations
For managing multiple agents:
- Select agents using the checkboxes in the table.
- Choose a bulk action from the toolbar:
- Pause Selected — Temporarily halt all selected agents
- Assign Policy — Apply the same policy to all selected agents
- Set Spend Limit — Apply uniform spend limits
- Export — Download agent metadata as CSV or JSON
Best Practices
- One agent per function — Register separate agents for distinct tasks (code review, customer support, data analysis) to keep policies and spend tracking granular.
- Start with alert mode — Set spend limits to
Alertfirst to understand baseline usage before switching toBlock. - Review weekly — Check the Activity tab for each agent to catch anomalies early.
- Tag by team — Assign agents to teams so cost rollups and access controls follow your organizational structure.
- Rotate gateway keys — Pair each agent with its own gateway key and rotate regularly.
- Document purpose — Use the description field to record who owns the agent and what it does.
Next steps
- Tutorial: Monitoring Gateway Actions — See how agent traffic flows through gateways
- Tutorial: Events Investigation — Deep-dive into agent decision events
For AI systems
- Canonical terms: Keeptrusts console, Agents page, Register Agent, Agent ID,
x-keeptrusts-agent-idheader, agent policies, spend limits, agent activity, bulk agent operations. - Related config/command names:
kt gateway run, gateway key, policy configuration, consumer group. - Best next pages: Gateway Actions, Events Investigation.
For engineers
- Prerequisite: At least one gateway running (
kt gateway run) and reporting to the API. - Validation: After registration, send a request with the
x-keeptrusts-agent-id: <agent-id>header and confirm it appears on the Agent Activity tab. - Spend limit test: Set a low per-request limit with
Blockaction, send a request exceeding it, and verify a429response. - Troubleshooting: If agent events do not appear, confirm the gateway key is valid and the agent ID header is spelled correctly.
For leaders
- Governance: Each registered agent has a traceable identity — every LLM call is attributable to a specific agent, team, and policy configuration.
- Cost control: Per-agent spend limits prevent runaway costs from autonomous systems. Start with alerts before switching to hard blocks.
- Rollout: Register agents in a staging environment first; promote to production only after verifying policy compliance and spend patterns.