CLI Reference

The Asqav CLI ships as an extra of the Python SDK. Install with pip install "asqav[cli]" and you have every command below. Most commands wrap a Python function of the same name. Use the SDK directly when you want programmatic control. All commands that talk to the API read ASQAV_API_KEY from the environment.

Set ASQAV_API_KEY in the environment, then run any command below.

Quickstart

Sixty-second guided walk-through. Detects whether ASQAV_API_KEY is set, prints the MCP config block for .mcp.json, a default Policy example, and the four next steps for a new install (create an agent, sign actions, verify anywhere, run asqav doctor).

bash
$ asqav quickstart

Doctor

Validate your governance setup. Runs three checks in order: (1) ASQAV_API_KEY is set, (2) the API is reachable via health_check(), (3) reports the installed SDK version. Exits non-zero on any failure, so it works as the first step in a CI workflow. The API-reachable check is skipped (not failed) when the key is missing.

bash
$ asqav doctor

Verify

Verify a signature by its ID. Public, no auth needed - calls asqav.verify_signature(signature_id) against the public verification surface. With --output json the full VerificationResponse is returned, including the IETF profile sub-axes (chain_valid, anchor_status_ots, anchor_status_rfc3161, signed_at_skew_seconds, missing_fields) when the cloud emitted them. Exits 1 if the signature is not found.

bash
$ asqav verify SIGNATURE_ID [--output text|json]

Arguments

Options

bash
$ asqav verify SIGNATURE_ID [--output text|json]

Sign

Issue a Compliance Receipt via the cloud /agents/{id}/sign route. Mirrors Agent.sign() end-to-end so every flag here maps 1:1 to a kwarg on the SDK call. Pass --action-json - to read the canonical Action JSON from stdin. The SDK derives action_ref from the JCS bytes when --action-ref is empty. When --policy-decision is deny or rate_limit, --reason is required.

bash
$ asqav sign --agent-id AGENT --action-type TYPE [options]

Options

bash
$ asqav sign \

Sync

Flush the local offline queue to the API. Prints one line per item with success ([ok]) or failure ([fail]) and a summary count at the end. Failed items remain queued for the next call.

bash
$ asqav sync

Demo

Run the local governance demo dashboard. Opens http://localhost:3030 with four pre-loaded scenarios (rm -rf, fintech wire transfer, k8s scale-to-zero, clinical lab order). No signup, no Docker, no API key required.

bash
$ asqav demo [--port PORT] [--no-browser]

Options

bash
$ asqav demo [--port PORT] [--no-browser]

Agents

Manage agents for your organization. The group exposes list, create, and revoke. All three read ASQAV_API_KEY from the environment.

Agents List

List all agents for your organization. Prints one row per agent: name (agent_id) [algorithm].

bash
$ asqav agents list

Agents Create

Create a new agent. Wraps asqav.Agent.create(name). The cloud mints the keypair. The response includes the agent ID, algorithm, and key ID.

Arguments

bash
$ asqav agents create my-agent

Agents Revoke

Revoke an agent's credentials. Irreversible. The reason is recorded in the audit trail.

bash
$ asqav agents revoke AGENT_ID [--reason REASON]

Arguments

Options

bash
$ asqav agents revoke agt_x7y8z9 --reason "key rotation"

Sessions

List sessions for the current org and end them when work is done. Wraps the /sessions surface.

Sessions List

List sessions. Prints one row per session with session ID, agent ID, status, and start time.

bash
$ asqav sessions list [--limit N] [--status STATUS] [--agent AGENT_ID]

Options

bash
$ asqav sessions list --limit 20 --status active

Sessions End

End a session by setting its status. PATCHes /sessions/{session_id}.

bash
$ asqav sessions end SESSION_ID [--status STATUS]

Arguments

Options

bash
$ asqav sessions end sess_abc123 --status completed

Queue

Inspect and clear the local offline queue used when the API is unreachable. Pair with asqav sync to flush.

Queue List

List pending items in the local queue. Prints one row per item: id, action type, agent, queued-at.

bash
$ asqav queue list

Queue Count

Show number of pending items in the local queue.

bash
$ asqav queue count

Queue Clear

Clear all pending items from the local queue. Prompts for confirmation unless --yes is passed.

bash
$ asqav queue clear [--yes]

Options

bash
$ asqav queue clear --yes

Audit Pack

Audit Pack export and policy_digest resolution under the IETF Compliance Receipts profile.

Audit-Pack Export

Export a signed Audit Pack bundle of receipts in [start, end). Calls POST /audit-pack/export. The bundle is signed with the org's most-recent active agent key over the JCS-canonical bundle bytes, so a verifier can rederive the digest and check the signature offline.

bash
$ asqav audit-pack export --start ISO --end ISO --output-file FILE [options]

Options

bash
$ asqav audit-pack export \

Audit-Pack Policy

Resolve a policy_digest to the retained policy artefact JSON. Calls GET /audit-pack/policy/{digest}. The receipt's policy_digest is sha256:<hex> over the canonical artefact JSON. This command fetches the artefact so a verifier can rederive the digest offline. Accepts both sha256:<hex> and bare 64-hex strings.

bash
$ asqav audit-pack policy DIGEST [--output json|text]

Arguments

Options

bash
$ asqav audit-pack policy DIGEST [--output json|text]

See EU AI Act Audit Pack for the bundle format.

Payloads

Erase persisted payloads for GDPR / UK-GDPR right-to-erasure flows.

Payloads Erase

Erase the persisted JSON payload for a signature record. Calls DELETE /signatures/payloads/{signature_id}. The cryptographic message bytes and chain hash stay untouched so the receipt remains verifiable. The human-readable JSON payload is replaced with a tombstone marker. Idempotent: replaying on an already-erased record returns 204. Prompts for confirmation unless --yes is passed.

bash
$ asqav payloads erase SIGNATURE_ID [--yes]

Arguments

Options

bash
$ asqav payloads erase SIGNATURE_ID [--yes]

Org

Organization-level settings.

Org Set-Compliance-Strict

Toggle per-org compliance_mode_strict. When enabled, the cloud rejects any sign request that is not flagged compliance_mode=true with HTTP 412 so non-instrumented call paths cannot slip past the receipts trail. Calls PATCH /orgs/{org_id} with {"compliance_mode_strict": <bool>}. Pass exactly one of --enable or --disable.

bash
$ asqav org set-compliance-strict ORG_ID (--enable | --disable)

Arguments

Options

bash
$ asqav org set-compliance-strict ORG_ID (--enable | --disable)

Keys

Local keypair management for algorithm agility, offline, and air-gapped flows.

Keys Generate

Generate a local keypair. Ed25519 and ES256 emit PKCS#8 PEM. ML-DSA-65 keygen is server-side only. The command rejects --algorithm ml-dsa-65 with an unsupported_algorithm error. Use asqav agents create to mint an ML-DSA key via the cloud KMS instead. When --out is set, the private key is written with mode 0600. The public key always prints to stdout.

bash
$ asqav keys generate [--algorithm ed25519|es256] [--out PATH]

Options

bash
$ asqav keys generate [--algorithm ed25519|es256] [--out PATH]

See Key Management for the cloud KMS path.

Migrate

Operator-only DB migration runner. Requires both ASQAV_API_KEY and ASQAV_MAINTENANCE_KEY in the environment.

Migrate Run

Trigger a maintenance migration. POSTs /maintenance/run-migration-{migration} with the X-Maintenance-Key header. Refuses to run when ASQAV_MAINTENANCE_KEY is missing.

Arguments

bash
$ asqav migrate run MIGRATION

Replay

Replay an agent's audit trail. Wraps asqav.replay() for the online path and asqav.replay_from_bundle() for the offline path. The online form requires both arguments. The offline form reads a compliance bundle JSON via --bundle. Exits non-zero if the chain integrity check fails. Use --output FILE to persist the timeline as JSON. This implies --json.

bash
$ asqav replay [AGENT_ID] [SESSION_ID] [--bundle FILE] [--json] [--output FILE]

Arguments

Options

bash
$ asqav replay [AGENT_ID] [SESSION_ID] [--bundle FILE] [--json] [--output FILE]

See Replay API for the underlying endpoint.

Replay Verify

Re-derive a session's IETF chain (sha256(canonical_json(signed_envelope))) and verify every step. Wraps asqav.replay() and runs timeline.verify_chain(). With --strict the command fails when any step lacks the cloud-emitted signed_envelope, so synthetic-shape fallback steps cannot prove byte-level integrity and cannot pass the gate.

bash
$ asqav replay-verify AGENT_ID SESSION_ID [--strict] [--output text|json]

Arguments

Options

bash
$ asqav replay-verify AGENT_ID SESSION_ID [--strict] [--output text|json]

Preflight

Run a pre-flight check (revocation + suspension + policy) for an action. Wraps Agent.get(agent_id).preflight(action_type). Exits non-zero when the action is blocked, so it works as a gate in shell pipelines. Prints the verdict (CLEARED / BLOCKED), the explanation, and a bulleted list of reasons.

bash
$ asqav preflight AGENT_ID ACTION_TYPE [--json]

Arguments

Options

bash
$ asqav preflight AGENT_ID ACTION_TYPE [--json]

Approve

Approve a pending signing-action session. Wraps asqav.approve_action(). Output shows progress as signatures_collected/approvals_required and the session status (APPROVED when the threshold is reached, otherwise PENDING).

bash
$ asqav approve SESSION_ID ENTITY_ID [--json]

Arguments

Options

bash
$ asqav approve SESSION_ID ENTITY_ID [--json]

See Approvals for the workflow this fits into.

Policies

Manage organization policies. The action enforced for a matching pattern is one of log, block, or block_and_alert.

Policies List

List all org policies. Prints one row per policy with ID, name, action pattern, action, and active/inactive flag.

bash
$ asqav policies list

Policies Create

Create a new policy. Defaults to --pattern "*" and --action block.

bash
$ asqav policies create --name NAME [--pattern PATTERN] [--action ACTION]

Options

bash
$ asqav policies create --name "block-writes" --pattern "data:write" --action block

Policies Delete

Delete a policy by ID.

Arguments

bash
$ asqav policies delete pol_abc123

See Policies for the policy model.

Webhooks

Manage outbound webhook subscriptions. Events are passed as a comma-separated list and stored as an array on the server.

Webhooks List

List configured webhooks. Prints one row per webhook: ID, URL, and the subscribed events.

bash
$ asqav webhooks list

Webhooks Create

Create a webhook subscription. URL should be HTTPS.

bash
$ asqav webhooks create --url URL [--events EVENTS]

Options

bash
$ asqav webhooks create --url https://example.com/hook --events signature.created,policy.blocked

Webhooks Delete

Delete a webhook by ID.

Arguments

bash
$ asqav webhooks delete whk_abc123

See Webhooks for event payloads.

Budget

Check or record agent spend. Wraps asqav.BudgetTracker.

Budget Check

Stateless arithmetic check: would --estimated-cost push --current-spend past --limit? Returns ALLOWED / DENIED plus the remaining headroom, and exits non-zero on DENIED. For server-side enforcement use budget record.

bash
$ asqav budget check --agent-id ID --limit X --estimated-cost X [options]

Options

bash
$ asqav budget check \

Budget Record

Sign a tamper-evident spend record on the server. The signed payload includes the cost, currency, cumulative spend after the record, and the configured limit.

bash
$ asqav budget record --agent-id ID --action TYPE --actual-cost X --limit X [options]

Options

bash
$ asqav budget record \

Compliance

Compliance bundle export. Wraps asqav.compliance.export_bundle.

Compliance Frameworks

List the compliance frameworks the bundle exporter recognizes. Prints one row per framework: key<TAB>name.

bash
$ asqav compliance frameworks

Compliance Export

Pull a session's signatures and export a Merkle-rooted compliance bundle. Wraps get_session_signatures() + export_bundle(). Use asqav compliance frameworks to list valid keys.

bash
$ asqav compliance export --session SESSION --output FILE [--framework KEY]

Options

bash
$ asqav compliance export \

Related