track_action
Create Ed25519-signed receipts to record AI agent actions with SHA-256 hashed inputs and outputs. Tracks model costs, token usage, latency, and constraints to establish cryptographic audit trails.
Instructions
Create a completed Ed25519-signed receipt for an AI agent action with automatic SHA-256 hashing of input and output data. Records model usage, costs, latency, and constraint evaluations. Returns the signed receipt with receipt_id for future reference. Use this as the primary tool for recording agent actions — prefer over create_receipt + complete_receipt for single-step actions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action name being recorded (e.g., "generate_code", "summarize_text", "classify_intent") | |
| input | No | Input data passed to the agent — automatically hashed with SHA-256, raw data is never stored | |
| output | No | Output produced by the agent — automatically hashed with SHA-256, raw data is never stored | |
| output_summary | No | Human-readable summary of the output for audit purposes (max 500 chars recommended) | |
| model | No | AI model used (e.g., "claude-sonnet-4-20250514", "gpt-4o", "gemini-2.0-flash") | |
| tokens_in | No | Input tokens consumed by the model | |
| tokens_out | No | Output tokens generated by the model | |
| cost_usd | No | Execution cost in USD (e.g., 0.0045) | |
| latency_ms | No | Total execution time in milliseconds | |
| tool_calls | No | Names of tools called during this action (e.g., ["web_search", "code_exec"]) | |
| tags | No | Arbitrary tags for filtering and categorization (e.g., ["production", "critical"]) | |
| confidence | No | Confidence score for the output quality, 0.0 to 1.0 | |
| metadata | No | Arbitrary key-value metadata attached to the receipt | |
| parent_receipt_id | No | Parent receipt ID for chaining — links this receipt to a previous step | |
| chain_id | No | Chain identifier for grouping related receipts — auto-generated if not provided | |
| constraints | No | Constraint definitions to evaluate against this receipt (e.g., max_latency_ms, max_cost_usd, min_confidence) | |
| expires_at | No | ISO 8601 datetime when this receipt expires (e.g., "2026-12-31T23:59:59Z") | |
| ttl_ms | No | Time-to-live in milliseconds from now — alternative to expires_at |