Skip to main content

Agent Security API

The Agent Security API protects AI agents by validating tool calls before execution and detecting anomalous behavior patterns. Project Scoping: Agent profiles are scoped by project. For the Developer API, project_id is automatically extracted from your API key. For the Consumer API, project_id must be provided in the request body.

Why Agent Security?

AI agents with tool access can be exploited to:
  • Execute dangerous commands: Shell injection, file system manipulation
  • Escalate privileges: Accessing restricted resources
  • Exfiltrate data: Sending data to external endpoints
  • Behave erratically: Unusual patterns indicating compromise

Endpoints

Validate Tool Call

Validate a tool call before allowing execution.
Request Body
Note: For Developer API, project_id is automatically extracted from your API key. For Consumer API, include project_id in the request body. Response (Allowed)
Response (Blocked)

Get Agent Stats

Get statistics for a specific agent.
Response

Register Agent

Register a new agent identity and receive a one-time-visible credential.
Request Body
Response
agent_secret is shown only once. Store it securely — it cannot be retrieved again, only rotated.

Rotate Agent Credential

Revoke the agent’s current credential and issue a new one.
Response

End Agent Session

End an agent session and clear its tracking data.

Agent Security Health

Health check for the agent security service. Useful for readiness probes before routing validation traffic.

Get Managed Policy

Get the org-managed update policy for an enrolled device (used by the desktop agent to apply fleet-managed update settings).
Response

SDK Usage

Risk Levels

Blocked Tools (Default)

These tools are blocked by default:
  • execute_shell, run_command, bash, system
  • delete_file, rm, rmdir
  • kill_process, terminate
  • send_email, http_post (without approval)

Project Isolation

Agent profiles are isolated by project. This means:
  • The same agent_id in different projects will have separate behavioral profiles
  • Profiles persist across restarts (stored in database)
  • Each project maintains its own baseline for anomaly detection
Developer API: project_id is automatically extracted from your API key. Ensure your API key is associated with a project. Consumer API: Include project_id in your request body. You must have access to the specified project.

Best Practices

  1. Validate every tool call: Don’t skip validation for “safe” tools
  2. Use sessions: Group related calls for better behavior analysis
  3. Review anomalies: Investigate when anomaly_score is high
  4. Set up alerts: Monitor for patterns indicating compromise
  5. Use project-scoped API keys: Ensure your API keys are associated with projects for proper isolation