Skip to Content
AgentShield
API Reference

Control Plane API

Complete reference for the AgentShield control plane. Sessions, members, agents, policies, approvals, audit, alerts, evidence, metrics, and chaos.

The control plane API is for humans and the automation that acts for them. Every /api/v1 route except sign-in and invitations requires Authorization: Bearer <token>. Agent signature headers are refused. Base URL in local development: http://127.0.0.1:8080.

The organization for every call is taken from the session's membership. No route accepts an organization id as authority.

Health

GET/health/live

Process liveness

No authenticationoperationId: getControlPlaneLive

This reports the process, not that every management route exists.

Responses

  • 200HealthLive

    Process is running

curl -X GET "http://127.0.0.1:8080/health/live"

Examples are generated from the schema. Values are placeholders.

GET/health/ready

Readiness

No authenticationoperationId: getControlPlaneReady

Returns 200 when PostgreSQL answers, otherwise 503.

Responses

  • 200HealthReady

    Database answered

  • 503HealthReady

    Process is up and the database is not available

curl -X GET "http://127.0.0.1:8080/health/ready"

Examples are generated from the schema. Values are placeholders.

Sessions

POST/api/v1/sessions

Create a human session

No authenticationoperationId: createSession

Checks the email and password of a bootstrapped user. There is no public registration route. The token is returned once and only its SHA-256 is stored. Agent signature headers are rejected.

Request body · required

  • emailstring (email)required
  • passwordstringrequired

    min length 12 · max length 128

Responses

  • 201Session

    Session token

  • 401ErrorBody

    Error

  • 403ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/sessions" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

GET/api/v1/sessions/current

The caller's user, organization, role, and session expiry

Bearer sessionoperationId: getCurrentSession

Responses

  • 200CurrentSession

    Current session

  • 401ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/sessions/current" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

DELETE/api/v1/sessions/current

End the session that made this request

Bearer sessionoperationId: revokeCurrentSession

Responses

  • 204no body

    Session ended. The token is refused from now on.

curl -X DELETE "http://127.0.0.1:8080/api/v1/sessions/current" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/sessions/current/password

Change the caller's password and end their other sessions

Bearer sessionoperationId: changeOwnPassword

Request body · required

  • current_passwordstringrequired
  • new_passwordstringrequired

    min length 12 · max length 128

Responses

  • 204no body

    Password changed. The calling session stays valid.

  • 403ErrorBody

    The current password is wrong

curl -X POST "http://127.0.0.1:8080/api/v1/sessions/current/password" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Members

Owners and admins manage the organization's members. With SMTP_URL configured, new members receive an emailed invitation; otherwise a one-time temporary password is returned once.

GET/api/v1/members

List the organization's members

Bearer sessionoperationId: listMembers

Implemented for owner and admin.

Responses

  • 200object

    Members

curl -X GET "http://127.0.0.1:8080/api/v1/members" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/members

Add a user with a generated temporary password

Bearer sessionoperationId: addMember

Implemented for owner and admin. Only an owner can grant owner. temporary_password is returned once and only its Argon2id hash is stored.

Request body · required

  • emailstring (email)required
  • display_namestringrequired

    min length 1 · max length 128

  • rolestringrequired

    one of owner, admin, operator, auditor, approver

Responses

  • 201any

    Member added

  • 409ErrorBody

    A user with this email exists

curl -X POST "http://127.0.0.1:8080/api/v1/members" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

PATCH/api/v1/members/{userId}

Change a member's role or status

Bearer sessionoperationId: changeMember

Implemented for owner and admin. Nobody changes their own role or status. Only an owner grants owner or changes an owner. The organization keeps an active owner. Disabling a user ends their sessions.

Parameters

  • userIdpath · string (uuid)required

Request body · required

  • rolestring

    one of owner, admin, operator, auditor, approver

  • statusstring

    one of active, disabled

Responses

  • 200Member

    Updated member

  • 403ErrorBody

    The change is not allowed for this caller

curl -X PATCH "http://127.0.0.1:8080/api/v1/members/$USER_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

POST/api/v1/members/{userId}/invitation

Email a new invitation and close the previous link

Bearer sessionoperationId: resendInvitation

Implemented for owner and admin when SMTP_URL is set. 409 when mail is not configured or the member has no open invitation.

Parameters

  • userIdpath · string (uuid)required

Responses

  • 201Member

    Invitation sent

  • 409ErrorBody

    Error

  • 502ErrorBody

    The mail server refused or did not answer

curl -X POST "http://127.0.0.1:8080/api/v1/members/$USER_ID/invitation" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Invitations

Public routes used by the invitation page. Every unknown, used, or expired token returns the same 404.

POST/api/v1/invitations/lookup

Who an open invitation is for

No authenticationoperationId: lookupInvitation

Public. The token is sent in the body, never the URL. Unknown, used, and expired tokens all return 404.

Request body · required

  • tokenstringrequired

    pattern ^[A-Za-z0-9_-]{43}$

Responses

  • 200object

    Open invitation

  • 404ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/invitations/lookup" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

POST/api/v1/invitations/accept

Choose a password and close the invitation

No authenticationoperationId: acceptInvitation

Public. Works once. The invitee then signs in with POST /api/v1/sessions.

Request body · required

Responses

  • 204no body

    Password set. The link no longer works.

  • 400ErrorBody

    Error

  • 404ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/invitations/accept" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Agents

GET/api/v1/agents

List agents in the caller's organization

Bearer sessionoperationId: listAgents

The organization comes from the session.

Parameters

  • limitquery · integer

    min 1 · max 200

  • cursorquery · string

Responses

  • 200AgentPage

    Agent page

  • 401ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/agents" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents

Register an agent public key

Bearer sessionoperationId: registerAgent

Stores the raw Ed25519 public key. Secret key fields are rejected. The caller must be an owner, admin, or operator.

Request body · required

  • namestringrequired

    min length 1 · max length 128

  • frameworkstringrequired

    one of langchain, langgraph, crewai, openai_agents, python, typescript, mcp, custom

  • public_keystringrequired

    Unpadded base64url of the raw 32-byte Ed25519 public key.

    pattern ^[A-Za-z0-9_-]{43}$

Responses

  • 201Agent

    Registered agent

  • 400ErrorBody

    Error

  • 401ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/agents" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

GET/api/v1/agents/{agentId}

Get one agent

Bearer sessionoperationId: getAgent

Returns 404 when the agent is outside the caller's organization.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Agent

  • 404ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents/{agentId}/revoke

Revoke an agent and its active credentials

Bearer sessionoperationId: revokeAgent

Revocation is permanent for the agent and its credential records.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Revoked agent

  • 404ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/revoke" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents/{agentId}/suspend

Suspend an agent without retiring its key

Bearer sessionoperationId: suspendAgent

The key stays active and the agent cannot call the gateway until a later phase resumes it.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Suspended agent

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/suspend" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents/{agentId}/resume

Let a suspended agent call again

Bearer sessionoperationId: resumeAgent

Implemented for owner and admin. A revoked agent stays revoked and returns 409.

Parameters

  • agentIdpath · string (uuid)required

Responses

  • 200Agent

    Agent is active

  • 409ErrorBody

    The agent is revoked

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/resume" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/agents/{agentId}/credentials/rotate

Add a new public key and mark the previous key rotated

Bearer sessionoperationId: rotateAgentCredential

The server stores the public key only and marks the previous active key rotated.

Parameters

  • agentIdpath · string (uuid)required

Request body · required

  • public_keystringrequired

    pattern ^[A-Za-z0-9_-]{43}$

Responses

  • 201Credential

    New credential metadata

curl -X POST "http://127.0.0.1:8080/api/v1/agents/$AGENT_ID/credentials/rotate" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Policies

GET/api/v1/policies

List policies in the caller's organization

Bearer sessionoperationId: listPolicies

Evaluation does not read this list. It reads policy_versions.

Responses

  • 200PolicyPage

    Policy page

curl -X GET "http://127.0.0.1:8080/api/v1/policies" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/policies

Create a policy and its first immutable version

Bearer sessionoperationId: createPolicy

Inserts an immutable version. A second active policy for the same organization or agent is a conflict.

Request body · required

  • namestringrequired
  • scopestringrequired

    one of organization, agent

  • agent_idstring (uuid)
  • documentPolicyDocumentrequired

    unknown fields rejected

    Show child fields
    • agentobject

      unknown fields rejected

      Show child fields
      • idstring
    • permissionsobjectrequired

      unknown fields rejected

      Show child fields
      • allowedstring[]required
      • deniedstring[]required
      • approval_requiredstring[]required

Responses

  • 201Policy

    Created policy

curl -X POST "http://127.0.0.1:8080/api/v1/policies" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

GET/api/v1/policies/{policyId}

Read one policy and the document of its current version

Bearer sessionoperationId: getPolicy

Implemented for any member of the organization.

Parameters

  • policyIdpath · string (uuid)required

Responses

  • 200any

    Policy and current document

  • 404ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/policies/$POLICY_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

PUT/api/v1/policies/{policyId}

Append a new policy version and move the current pointer

Bearer sessionoperationId: replacePolicy

Appends a version and moves the current pointer. Existing version rows are not edited.

Parameters

  • policyIdpath · string (uuid)required

Request body · required

  • documentPolicyDocumentrequired

    unknown fields rejected

    Show child fields
    • agentobject

      unknown fields rejected

      Show child fields
      • idstring
    • permissionsobjectrequired

      unknown fields rejected

      Show child fields
      • allowedstring[]required
      • deniedstring[]required
      • approval_requiredstring[]required

Responses

  • 200Policy

    Updated policy pointer

curl -X PUT "http://127.0.0.1:8080/api/v1/policies/$POLICY_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Approvals

GET/api/v1/approvals

List approval requests

Bearer sessionoperationId: listApprovals

Implemented for owner, admin, and approver. Agents cannot call this route.

Responses

  • 200ApprovalPage

    Approval page

curl -X GET "http://127.0.0.1:8080/api/v1/approvals" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/approvals Reserved · not registered

Record an approval request for an existing authorization decision

Bearer sessionoperationId: createApproval

Not implemented. Reserved for the gateway service identity. Agent credentials and the agent that initiated the action are rejected.

Request body · required

  • authorization_decision_idstring (uuid)required
  • payload_hashstringrequired

    pattern ^[0-9a-f]{64}$

  • expires_atstring (date-time)required

Responses

  • 201Approval

    Pending approval

  • 403ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/approvals" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

POST/api/v1/approvals/{approvalId}/approve

Approve the exact bound payload

Bearer sessionoperationId: approveRequest

The caller must be a human approver, admin, or owner in the same organization. The same user id cannot approve an agent with that id. The approval binds to payload_hash and expires.

Parameters

  • approvalIdpath · string (uuid)required

Responses

  • 200Approval

    Approved, not yet consumed

  • 409ErrorBody

    Error

curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/approve" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/approvals/{approvalId}/reject

Reject an approval request

Bearer sessionoperationId: rejectRequest

A rejected approval cannot be replayed.

Parameters

  • approvalIdpath · string (uuid)required

Responses

  • 200Approval

    Rejected approval

curl -X POST "http://127.0.0.1:8080/api/v1/approvals/$APPROVAL_ID/reject" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Audit, events, and incidents

GET/api/v1/events

List redacted security events

Bearer sessionoperationId: listEvents

Owner, admin, auditor, and operator can list redacted events for their organization.

Parameters

  • limitquery · integer

    min 1 · max 200

  • cursorquery · string

Responses

  • 200EventPage

    Event page

curl -X GET "http://127.0.0.1:8080/api/v1/events" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

GET/api/v1/incidents

List security incidents

Bearer sessionoperationId: listIncidents

Owner, admin, and auditor sessions can list incidents for their organization.

Responses

  • 200IncidentPage

    Incident page

curl -X GET "http://127.0.0.1:8080/api/v1/incidents" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

GET/api/v1/audit/exports

List exported audit head copies

Bearer sessionoperationId: listAuditHeadExports

Owner, admin, and auditor can list exports for their organization.

Responses

  • 200AuditExportPage

    Export page

curl -X GET "http://127.0.0.1:8080/api/v1/audit/exports" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/audit/exports

Export the current audit head hash

Bearer sessionoperationId: exportAuditHead

Stores an external copy of the current organization head hash.

Request body · required

  • destinationstringrequired

    min length 1 · max length 256

Responses

  • 201AuditExport

    Stored export

curl -X POST "http://127.0.0.1:8080/api/v1/audit/exports" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Alerts

GET/api/v1/alerts

Content analysis alerts, newest first

Bearer sessionoperationId: listAlerts

Implemented for owner, admin, and auditor. Alerts are advice about calls that already ran.

Parameters

  • statusquery · string

    one of open, acknowledged, resolved

Responses

  • 200object

    Alerts

curl -X GET "http://127.0.0.1:8080/api/v1/alerts" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

PATCH/api/v1/alerts/{alertId}

Acknowledge or resolve an alert

Bearer sessionoperationId: changeAlert

Implemented for owner and admin. Forward only. Appends alert.acknowledged or alert.resolved. No decision changes.

Parameters

  • alertIdpath · string (uuid)required

Request body · required

  • statusstringrequired

    one of acknowledged, resolved

Responses

  • 200Alert

    Updated alert

  • 409ErrorBody

    Error

curl -X PATCH "http://127.0.0.1:8080/api/v1/alerts/$ALERT_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

Evidence

GET/api/v1/evidence

Evidence bundles the event relay stored

Bearer sessionoperationId: listEvidence

Implemented for owner, admin, and auditor. Newest first, at most 200.

Parameters

  • execution_idquery · string (uuid)

Responses

  • 200object

    Evidence records

curl -X GET "http://127.0.0.1:8080/api/v1/evidence" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

GET/api/v1/evidence/{evidenceId}

Read one bundle after checking its SHA-256

Bearer sessionoperationId: readEvidence

Implemented for owner, admin, and auditor. 409 evidence_integrity_failed when the stored object no longer matches its recorded hash. Every read appends evidence.viewed or evidence.integrity_failed. 503 when storage is not configured.

Parameters

  • evidenceIdpath · string (uuid)required

Responses

  • 200object

    Verified bundle

  • 409ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/evidence/$EVIDENCE_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Metrics

GET/api/v1/metrics/reliability

Tool reliability over the last N minutes

Bearer sessionoperationId: getReliability

Implemented for owner, admin, auditor, and operator. Built from per-minute rows the event relay computes.

Parameters

  • minutesquery · integer

    min 5 · max 10080

Responses

  • 200object

    Summary per tool and calls per minute

curl -X GET "http://127.0.0.1:8080/api/v1/metrics/reliability" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Chaos

Owners and admins run catalog scenarios against the gateway's real authorization, limit, timeout, and body-limit code. passed is stored only when the defensive behavior was observed; a missing observation is failed.

GET/api/v1/chaos/scenarios

List the chaos scenario catalog

Bearer sessionoperationId: listChaosScenarios

Implemented for owner and admin. Disabled scenarios are listed and cannot be started.

Responses

  • 200object

    Catalog

curl -X GET "http://127.0.0.1:8080/api/v1/chaos/scenarios" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

GET/api/v1/chaos/experiments

List the 50 most recent experiments

Bearer sessionoperationId: listChaosExperiments

Implemented for owner and admin. Newest first.

Responses

  • 200object

    Recent experiments

curl -X GET "http://127.0.0.1:8080/api/v1/chaos/experiments" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

POST/api/v1/chaos/experiments

Start a chaos experiment

Bearer sessionoperationId: createChaosExperiment

Implemented for owner and admin. Runs one enabled catalog scenario. A missing observation is stored as failed. The response is the stored result, and status passed is returned only when the harness observed the defensive behavior.

Request body · required

  • agent_idstring (uuid)required
  • scenario_idstringrequired

Responses

  • 201ChaosExperiment

    Experiment finished. passed means the defensive behavior was observed.

  • 409ErrorBody

    The scenario is disabled

curl -X POST "http://127.0.0.1:8080/api/v1/chaos/experiments" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @body.json

Examples are generated from the schema. Values are placeholders.

GET/api/v1/chaos/experiments/{experimentId}

Read one chaos experiment

Bearer sessionoperationId: getChaosExperiment

Implemented for owner and admin. Returns the stored result for the caller's organization.

Parameters

  • experimentIdpath · string (uuid)required

Responses

  • 200ChaosExperiment

    Stored experiment

  • 404ErrorBody

    Error

curl -X GET "http://127.0.0.1:8080/api/v1/chaos/experiments/$EXPERIMENT_ID" \
  -H "Authorization: Bearer $AGENTSHIELD_TOKEN"

Examples are generated from the schema. Values are placeholders.

Was this page helpful?

On this page