Reference
alter audit
Read the audit log: runtime calls, portal actions, grant events, and traces.
Every credential-touching call and every admin action produces an audit row. These read-only commands query the log from several angles.
alter audit list [--since ...] [--start ...] [--end ...] [--action ...] [--policy-decision ...] [--agent ...] [--channel ...] [--root-grantee ...]alter audit export --start ... --end ... [--format csv|jsonl] [--tag ...] [--out ...]alter audit providers [--app ...]alter audit show <trace-id>alter audit explain <trace-id>alter audit portal-actions [--start ...] [--end ...] [--channel ...] [--resource-type ...]alter audit grant-events [--start ...] [--end ...] [--grant-type ...] [--provider ...]alter audit traces [--start ...] [--end ...] [--actor ...]alter audit threads [--start ...] [--end ...] [--app ...] [--actor ...]alter audit thread <thread-id>alter audit agents [--start ...] [--end ...] [--app ...]alter audit agent <actor-id> [--actor-kind actor|agent|key] [--additional-key-ids ...]alter audit integrity-check --start ... --end ... [--table ...]All commands need dashboard_audit:read and accept --output. For line-oriented pipelines, use --output jsonl with jq / grep. That is also the CLI’s export path — alter audit list --since 30d --output jsonl > audit.ndjson is the programmatic equivalent of the dashboard’s CSV/NDJSON export. Enum, ID, and date filters are validated client-side, so a typo fails fast; free-form filters (--action, --provider, --resource-type) pass through and simply match nothing when misspelled.
alter audit explain <trace-id> is the diagnostic companion to show: instead of raw events, it translates the trace’s terminal state into a concrete fix — a policy denial quotes the row’s one-sentence reason (which kind of rule refused it, and at which level), or, for a denial no rule made (such as a grant’s lifetime or a scope mismatch), the row’s own policy reason, and names the policy posture to review (alter policy show-app); a refusal by the agent’s capability allowlist lists the scopes the allowlist does not cover (saying how many more there are when the row capped the list, or did not list every provider), or for a managed secret names the slug to add under managed_secret_slugs, and points at alter agents show then alter agents update --scopes (no policy rule refused it, so widening a policy does not help); Alter’s built-in refusal of an operation that would leave the caller holding a provider credential (credential_minting_refused) gives the command that creates a credential_minting allowance for the provider and every operation the request path could be, or says that no allowance can cover a path that could not be read, and a successful trace that such an allowance let through names the operation and the allowing rule with the command that deletes it at its home target; a capability check that could not complete (a reason ending in scope_check_unavailable) was refused fail-closed and is safe to retry with backoff; a scope mismatch names the rotate command; a suspended agent points at alter agents resume (suspension is reversible — re-consent and rotation do not help); a revoked agent points at recreating it (alter agents create — revocation is terminal); a revoked/expired grant points at re-acquiring it (re-consent for OAuth; a new managed-secret grant, or a managed-secret Connect session for an end user’s own key — rotating a credential does not restore a grant); an unexplained provider 4xx points at the request-shape lint in alter verify (a provider 401/403 points instead at re-consent for OAuth, at rotating a managed-secret provider’s developer credential, or, for an end user’s own key, at a managed-secret Connect session with repair_grant_id, and a 429 at backoff — do not run verify for those); a provider 5xx says retry with backoff. For a managed secret whose template exchanges a stored client credential for a short-lived token, the token exchange’s own terminals are explained too: a rejected credential says which one the provider refused, the client pair (rotate the client secret with alter managed-secrets rotate <provider>) or an API user’s stored login (update only the login, keeping the client secret: alter managed-secrets rotate <provider> --credentials @login.json with no --credential-value), and whether the request only replayed a rejection Alter is holding (5 minutes for a client pair, 30 for a login) without contacting the provider; stored fields that cannot form a token request name the fields to fix, or, for a token endpoint URL whose host is not allowed, alter managed-secrets set-allowed-hosts; an unreachable token endpoint and Alter’s spent request budget toward a provider both say to wait the response’s Retry-After and retry; a token response with no usable token points at the stored token endpoint URL; and a minted token the provider answered with 401, which Alter discards, says to retry, since the retry gets a fresh token. The mapping is deterministic over fields the audit rows already carry — when nothing matches, it says so and defers to show.
explain accepts json, jsonl, or table. Its report is a single object,
so jsonl falls back to pretty-printed JSON.
Time filters: --start <iso> / --end <iso> give absolute bounds on every list-style command. The --since <duration> shorthand (e.g. 1h, 7d) — a relative start — is only available on audit list; the other list-style commands accept --start / --end only. On audit list, --start and --since are mutually exclusive.
Audit rows across the trail — token retrievals, outbound API calls, approvals, grant and delegation lifecycle, portal and Wallet policy changes, and provisioning.
| Flag | Default | Description |
|---|---|---|
--since <duration> | — | Relative start, e.g. 24h, 7d. Mutually exclusive with --start. |
--start <iso> / --end <iso> | — | Absolute bounds. |
--app <app-id-or-name> | all | Filter by app. |
--action <action> | all | e.g. token.retrieved. |
--actor <actor-id> | all | Filter by actor. |
--agent <agent-id> | all | Rows one managed agent performed, and rows about a delegation made for it (target_agent_id): the id field of alter agents list --output json. A malformed ID exits 2 before any request. A backend that did not apply the filter exits 1 with no rows. |
--provider <provider> | all | Filter by provider ID (e.g. google), not display name. |
--policy-decision <decision> | all | ALLOW, DENY, or ERROR (case-sensitive). |
--channel <kind> | all | The channel the row came through (the actor_source field): portal (the dashboard), pat (the CLI), sdk, system, or end_user (an end user in the Wallet or Connect). Repeat to include several, as the dashboard’s channel filter does. Any other value exits 2 before any request. A backend that did not apply the filter exits 1 with no rows. |
--root-grantee <id> | all | Filter by root grantee: the ID of the end user, group or agent the access was originally granted to, which is the id field of alter end-users list, alter managed-secrets groups list or alter agents list. A malformed ID exits 2 before any request. A backend that did not apply the filter exits 1 with no rows. See Search by root grantee. |
--tag <key=value> | all | Rows whose grant or agent carries this tag now (repeatable; every tag must match). Key and value are exact and case-sensitive. Audit rows hold no tags of their own, so this reads the current tags, not those at the time of the event. |
--limit <n> | 100 | Page size (1–500). |
--offset <n> | 0 | Pagination offset. |
alter audit list --since 24h --policy-decision DENYSearch by root grantee
Section titled “Search by root grantee”--root-grantee <id> narrows the list to access originally granted to one end user, group or agent. Take the ID from the id field of alter end-users list --output json for an end user, alter managed-secrets groups list --output json for a group, or alter agents list --output json for an agent. The filter composes with every other list filter and with --limit / --offset.
alter audit list --since 7d --root-grantee 3f6c2a1e-8b9d-4c7e-a5f0-1d2e3f4a5b6c --output jsonWhen the backend applies the filter, its response carries a root_grantee_coverage field. The CLI prints that value and what it means to stderr, so a script can tell the result is partial. stdout carries the rows only, in every --output format. Today the value is contract_and_legacy_direct, and the CLI prints:
Records that carry attribution_version 2 are found wherever they name their root grantee: credential use, direct or through a delegation, refreshes, provider calls, grant and delegation lifecycle events, and approvals. Of older records, which carry no attribution_version, only token and managed-secret records of the user’s, group’s or agent’s direct use of its own grant are found. Attempts refused before the grant or its delegation chain was identified, Connect session requests, and older records of every other kind are not included.
An older delegated record (one with no attribution_version) names the delegate, not the original grantee, which is why older access through a delegation is not found. Existing rows are never filled in later, so an empty result does not mean the access was never used. Rows that never carry a grantee (portal and Wallet configuration changes, and IDP provisioning) are left out while the filter is set. A root_grantee_coverage value this CLI version does not recognize still marks the result as partial. The CLI prints the raw value with a generic notice.
A response without a root_grantee_coverage value comes from a backend that predates the filter. That backend ignores --root-grantee and returns the unfiltered trail. The CLI then prints no rows, says on stderr that --root-grantee was not applied, and exits 1.
--tag works the same way: the backend echoes the filter it applied as tag_filter, and a response whose tag_filter is missing or names other tags means the filter was not applied. The CLI then prints no rows, says on stderr that --tag was not applied, and exits 1.
The table’s RULE column names the policy rule a row is about: the rule that
decided a policy decision (a deny, an IP-allowlist rejection, a step-up or
approval requirement, or the rule whose obligations shaped a permit), or the
policy rule a portal or Wallet change created, updated, or deleted. In JSON
output the same ids are policy.policy_rule_id (the policy_rule_id field of
the policy object) and resource_id. End-user
policy changes made in the Wallet appear with log_type end_user_config,
actor: null and the end user who made the change in end_user — for
example:
alter audit list --since 7d --action policy_rule.created --output json \ | jq '.[] | {log_type, resource_id, actor: (.end_user.identifier // .actor.identifier // .developer_id)}'In --output json, each row’s action_type is read, write, denied
or error: denied marks a request Alter refused before the provider was
called (a policy, scope, approval, key or rate-limit refusal of a credential
request, or an outbound API call it cannot send as written), and error is
everything else that did not succeed, server faults included.
Every list-style audit command emits the rows themselves in every output
format — --output json is the rows array, matching every other list
command. When more rows remain, the command prints the next --offset to run
on stderr, so a | jq pipeline keeps clean data on stdout.
export
Section titled “export”Write every matching row to a file, with no paging. Needs dashboard_audit:read, and is rate limited per principal.
| Flag | Default | Description |
|---|---|---|
--start <iso> / --end <iso> | required | The date range. |
--format <format> | csv | csv or jsonl (one JSON object per line). |
--app <app-id-or-name> | all | Filter by app. |
--action <action> | all | e.g. token.retrieved. |
--policy-decision <decision> | all | ALLOW, DENY, or ERROR (case-sensitive). |
--provider <provider> | all | Filter by provider ID. |
--actor <actor-id> | all | Filter by actor. |
--agent <agent-id> | all | Filter to one managed agent. |
--root-grantee <id> | all | Filter by root grantee, as on list. |
--tag <key=value> | all | Filter by tag, as on list (repeatable). |
--out <file> | server’s file name | Where to write the file, or - for stdout. On Linux and macOS the file is written readable only by the current user, including when it replaces an existing file, and a symbolic link at that path is refused. |
The command prints a warning on stderr when the file is partial: trimmed to the export cap, limited to the rows this token may see, or, with --root-grantee, missing rows that record no grantee. Exit code 0 does not on its own mean the file is complete.
An export without the X-Audit-Root-Grantee-Coverage header comes from a backend that predates --root-grantee. That backend ignores the filter and returns the unfiltered trail. The CLI then writes no file, says on stderr that --root-grantee was not applied, and exits 1. With --tag, the same holds for an export without a matching X-Audit-Tag-Filter header.
alter audit export --start 2026-10-01T00:00:00Z --end 2026-10-31T00:00:00Z \ --format jsonl --tag run=42 --out october.jsonlproviders
Section titled “providers”The provider IDs present in an app’s audit events — the values --provider
accepts. One vocabulary across categories: OAuth provider IDs (google),
managed-secret template IDs (openai) — a custom managed-secret provider is
identified by its name-derived slug — and identity-provider types (okta).
Derived from the audit data itself (the same source as the dashboard’s
Provider filter dropdown), so a provider whose configuration was since deleted
still appears as long as its audit rows do.
| Flag | Default | Description |
|---|---|---|
--app <app-id-or-name> | ALTER_APP_ID / workspace pin | App whose audit trail to facet. |
alter audit providers --app my-appalter audit providers --output json | jq -r '.[].provider_id'Show every event for one trace, by trace ID.
alter audit show <trace-id>portal-actions
Section titled “portal-actions”Admin actions taken in the dashboard or via the CLI — app CRUD, key mints, policy edits.
The default table includes TYPE (read, write, or error) and RESULT (success, failure, denied, or error). When a record omits the classification, TYPE displays —; additive future string values are shown verbatim instead of aborting the listing. Successful list/export/integrity operations remain visible as reads; their summary payload is not reported as a created resource. Failed or denied dashboard actions have type error, regardless of the intended operation (denied applies to credential requests and API calls Alter refused; see list).
| Flag | Description |
|---|---|
--channel <kind> | The channel the action came through: portal (the dashboard), pat (the CLI), sdk, system, or end_user (an end user in the Wallet or Connect). Use pat to see CLI-driven actions. --principal-kind is a hidden alias that sends the same filter; passing both with different values is a usage error. |
--resource-type <type> | Filter by resource type. |
--action <action> | e.g. app.created. |
--app, --start, --end, --limit, --offset | As above (--limit range 1–500, default 100). |
# BSD/macOS date:alter audit portal-actions --channel pat \ --start $(date -u -v-7d +%Y-%m-%dT%H:%M:%SZ)# GNU date (Linux): --start $(date -u -d "7 days ago" +%Y-%m-%dT%H:%M:%SZ)grant-events
Section titled “grant-events”Grant-lifecycle events for both OAuth and managed-secret grants. On delegation.* rows that carry attribution_version 2, the GRANT column is the delegated (child) grant and DELEGATED TO names the agent it was delegated to; older rows, with no attribution_version, show the parent grant. A cascade written from this release lists one row per revoked child, so the count of rows is the count of delegations ended.
| Flag | Description |
|---|---|
--grant-type <type> | oauth or managed_secret. |
--provider <provider> | Filter by provider ID (e.g. google), not display name. |
--app, --start, --end, --limit, --offset | As above (--limit range 1–500, default 100). |
# BSD/macOS date:alter audit grant-events --grant-type oauth \ --start $(date -u -v-30d +%Y-%m-%dT%H:%M:%SZ)# GNU date (Linux): --start $(date -u -d "30 days ago" +%Y-%m-%dT%H:%M:%SZ)traces
Section titled “traces”Trace summaries — one row per request trace, with event count and status.
| Flag | Description |
|---|---|
--actor <actor-id> | Filter by actor. |
--app, --start, --end, --limit, --offset | As above (--limit range 1–200, default 50). |
# BSD/macOS date:alter audit traces --app <app-id-or-name> \ --start $(date -u -v-24H +%Y-%m-%dT%H:%M:%SZ)# GNU date (Linux): --start $(date -u -d "24 hours ago" +%Y-%m-%dT%H:%M:%SZ)threads
Section titled “threads”Conversation threads — groups of related traces. One row per thread, with trace and event counts.
| Flag | Description |
|---|---|
--actor <actor-id> | Filter by actor. |
--app, --start, --end, --limit, --offset | As above (--limit default 50, max 200). |
alter audit threads --app <app-id-or-name>thread
Section titled “thread”Show every trace and event for one thread, by thread ID.
alter audit thread <thread-id>agents
Section titled “agents”Audit activity grouped by actor: one row per agent-identity key group, registered caller, or effective agent, with thread / trace / event counts. Key groups (principal_kind: "key") are the primary kind: keys sharing one agent identity merge into a single row whose keys facets carry the per-key IDs and counts (key_count is the group’s true distinct-key total).
| Flag | Description |
|---|---|
--app, --start, --end, --limit, --offset | As above (--limit default 50, max 200). |
alter audit agents --app <app-id-or-name>Show one actor’s audit detail (its threads and traces), by ID.
| Flag | Description |
|---|---|
--actor-kind <kind> | What <actor-id> is: actor (default, an actor ID), agent (an effective-agent ID), or key (an API-key ID, the primary agent identity in the grouped view). --principal-kind is a hidden alias that sends the same value; passing both with different values is a usage error. |
--additional-key-ids <ids...> | Sibling API-key IDs of a multi-key agent group (repeat the option or space-separate IDs; at most 50). Requires --actor-kind key; merges every key’s events into one timeline, like the dashboard’s “All keys” drill-down. |
--app <app-id-or-name> | Filter by app. |
alter audit agent <actor-id> --actor-kind agent# Merge a multi-key agent group's timeline (ids from `alter audit agents` → keys facets):alter audit agent <key-id> --actor-kind key --additional-key-ids <key-id-2> <key-id-3>integrity-check
Section titled “integrity-check”Verify audit-log integrity over a date window. Read-only: the server recomputes each row’s content hash and, on credential rows that carry one, its lineage hash, and reports any row where either no longer matches (tampering), mutating nothing. Each entry of invalid_rows names the row’s table and id and, in failed_hash, which hash failed: content, lineage or both. Between them the two hashes cover how a credential row’s access was authorized: the grantee, the access path and delegation chain, the verified end-user subject where one was recorded, and the root grantee, except references to records that can be deleted (an end user, an agent, an API key), which are cleared when that record is. The end user’s display identifier and name are recorded but not hash-covered. Rows written before the lineage hash was introduced carry none and are checked by content hash alone. The window must be 90 days or less.
| Flag | Required | Description |
|---|---|---|
--start <iso> | yes | Start of the window (inclusive). |
--end <iso> | yes | End of the window (exclusive). Window must be ≤ 90 days. |
--table <name> | no | Limit to one audit table (default: all): api-calls, oauth-tokens, or managed-secrets. |
# BSD/macOS date:alter audit integrity-check \ --start $(date -u -v-7d +%Y-%m-%dT%H:%M:%SZ) \ --end $(date -u +%Y-%m-%dT%H:%M:%SZ)# GNU date (Linux): --start $(date -u -d "7 days ago" +%Y-%m-%dT%H:%M:%SZ)Recipes
Section titled “Recipes”Investigate denied calls
# Recent denialsalter audit list --since 24h --policy-decision DENY# Find a trace to expand (trace IDs come from `audit traces`), then drill in# (BSD/macOS date; GNU: --start $(date -u -d "24 hours ago" +%Y-%m-%dT%H:%M:%SZ))alter audit traces --start $(date -u -v-24H +%Y-%m-%dT%H:%M:%SZ) \ --output json | jq -r '.[].trace_id'alter audit show <trace-id>Stream a day of activity into a pipeline
alter audit list --since 24h --output jsonl | jq -c 'select(.action == "token.retrieved")'Find CLI / PAT-driven admin actions
# BSD/macOS date:alter audit portal-actions --channel pat \ --start $(date -u -v-7d +%Y-%m-%dT%H:%M:%SZ)# GNU date (Linux): --start $(date -u -d "7 days ago" +%Y-%m-%dT%H:%M:%SZ)Related
Section titled “Related”- Audit logs — what gets recorded and why
alter policy— the policy whose decisions show up here