Skip to content
Workforce IdentityMarkdown

Follow what an agent did

Read every token an agent was issued or refused, every exchange, every policy decision and every status change, per agent or per user.

Dashboard and API

After the fact, security and compliance teams and agent owners ask what did this agent do?, and users ask what did agents do for me? The realm’s audit trail answers both, one agent or one user at a time.

Before you start:

  • Who can do it: to read anyone’s trail but your own, a realm administrator or a member of a group holding RealmViewer; any user reads their own.
  • Where: the API, one principal at a time (Call the API shows how to get $CVYUH_SESSION). In the dashboard, Audit → Authentication lists the realm’s authentication records, tokens included, and Audit → Config its changes, agents’ included.
  • What you need: the agent’s or the user’s id, the id their record carries.
  1. Read one agent’s trail:

    Terminal window
    curl "https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?agent=6f1c2a9e-4b7d-4e3a-9c51-2d8f0b7a1e44" \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
  2. Or one user’s, which includes what agents did in their name:

    Terminal window
    curl "https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?person=9d4e2a71-0c3b-4f5e-8a6d-1b7c9e2f0a34" \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

    A user reads their own at https://foobar.cvyuh.com/api/v0/am/audit/v1/trail/me. Both answer a page at a time, chosen with page and pageSize.

EntrySays
Token issuedwhich grant, what was asked, what was granted, for which API, the token’s id, the agents acting
Token refusedwhat was asked, and why it was refused
Exchangethe user, the agents outermost first, the token it came from and the one issued, or why refused
Policy decisionallow or deny, on what, for whom
Status changeAGENT_QUARANTINED, AGENT_RELEASED, AGENT_KILLED or AGENT_RETIRED, with before and after, and who made it
RevocationTOKEN_REVOKED (a client revoked a token), APP_TAKEN_BACK or AGENT_TAKEN_BACK (a user removed an app or an agent), always recorded

Each entry carries the ids that tie it to the rest of the same piece of work, such as the token’s id and the sign-in’s sid, so you can follow one request from a token to every exchange made from it. A refused token request says which error the agent got, such as invalid_client; the reason behind an invalid_client isn’t recorded, so read the agent’s chain to find it (AI agents).

By default the trail keeps every deny and every decision involving an agent. To add each user’s own allowed requests too:

Terminal window
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/authorizationSettings/authorizationSettings \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
-H "Content-Type: application/json" \
-d '{ "auditDecisions": "all" }'

That’s a record per request, and it grows fast.

The answer’s events.totalCount counts every record about the principal. A brand-new agent has none until its first token request; a status change you just made shows at the top of events, and in changes for an agent.