AgentGuard
v0.3.1Local spend caps, kill-switch blocking and Ed25519-signed receipts for AI agent tool calls.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
spend_decide
Gate a model call BEFORE it runs. Pass metadata only (model, token counts, endpoint URL), never prompt content. Returns allow/block plus an Ed25519-signed, content-free receipt with model and hosting provenance (weights origin, jurisdiction, retention). Unknown self-hosted models need set_model_cost first (fail-closed). Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
| Parameter | Type | Description |
|---|---|---|
input_tokens * | integer | Projected input tokens |
model * | string | Model name, e.g. llama-3.1-8b-instruct or gpt-5-mini |
output_tokens * | integer | Projected output tokens |
agent_id | string | Optional agent identifier; signed as actor.agentId on spend_decide |
endpoint_url | string | Endpoint URL. Unrecognized endpoints route as self-hosted (zero retention, your jurisdiction). |
task_id | Optional task identifier; signed as actor.taskId on spend_decide | |
workflow_id | Optional workflow identifier; signed as actor.workflowId on spend_decide |
verify_receipt
Independently verify an AgentGuard signed receipt. Returns valid true/false. Tampering with any signed field makes verification fail. Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
| Parameter | Type | Description |
|---|---|---|
receipt_json * | string | The signed receipt entry as a JSON string |
agent_id | string | Optional agent identifier; signed as actor.agentId on spend_decide |
public_key_hex | string | Signer public key (64 hex characters). Defaults to this server signer. |
task_id | Optional task identifier; signed as actor.taskId on spend_decide | |
workflow_id | Optional workflow identifier; signed as actor.workflowId on spend_decide |
export_receipts
Export the tenant decision ledger, including earlier process runs, as a hash-chained array of signed receipts with a chain verification result. Memory mode exports this process only. Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
| Parameter | Type | Description |
|---|---|---|
agent_id | string | Optional agent identifier; signed as actor.agentId on spend_decide |
task_id | Optional task identifier; signed as actor.taskId on spend_decide | |
workflow_id | Optional workflow identifier; signed as actor.workflowId on spend_decide |
set_model_cost
Register a cost for a model with no built-in pricing (required for self-hosted models: AgentGuard fails closed on unknown costs). Cents per 1,000 tokens. Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
| Parameter | Type | Description |
|---|---|---|
input_cents_per_ktok * | number | |
model * | string | |
output_cents_per_ktok * | number | |
agent_id | string | Optional agent identifier; signed as actor.agentId on spend_decide |
task_id | Optional task identifier; signed as actor.taskId on spend_decide | |
workflow_id | Optional workflow identifier; signed as actor.workflowId on spend_decide |
provenance_preview
Preview the provenance AgentGuard would attest for a model and endpoint WITHOUT spending: model identity, weights origin country (China-origin families flagged), hosting jurisdiction, retention posture. Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
| Parameter | Type | Description |
|---|---|---|
model * | string | |
agent_id | string | Optional agent identifier; signed as actor.agentId on spend_decide |
endpoint_url | string | |
task_id | Optional task identifier; signed as actor.taskId on spend_decide | |
workflow_id | Optional workflow identifier; signed as actor.workflowId on spend_decide |
spend_status
Show the active policy: caps, tenant, enforcement mode, decisions so far this session, and the signer identity. Optional agent_id, task_id and workflow_id accept identifiers only; spend_decide binds them into the signed actor. Read-only and cost-configuration tools accept these fields without recording a spend decision.
| Parameter | Type | Description |
|---|---|---|
agent_id | string | Optional agent identifier; signed as actor.agentId on spend_decide |
task_id | Optional task identifier; signed as actor.taskId on spend_decide | |
workflow_id | Optional workflow identifier; signed as actor.workflowId on spend_decide |