record_action
Record agent actions to an immutable audit hash trail. Log action type, parameters, reasoning, and authorization after every significant operation for cryptographic proof.
Instructions
Record an agent action to the AgentSeal audit hash trail. Call this after every significant action (sending emails, modifying files, running queries, making API calls) to create a cryptographically sealed record of what happened and why.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | Identifier for this agent (e.g. 'research-bot', 'finance-agent') | |
| action_type | Yes | What type of action was taken (e.g. 'email:send', 'file:write', 'api:call', 'db:query') | |
| action_params | No | Parameters of the action (e.g. {to: 'user@example.com', subject: '...'}) | |
| reasoning | No | Why you decided to take this action — your chain of thought | |
| authorized_by | No | Who or what authorized this action (e.g. 'user:alice', 'policy:auto-approve') |
Implementation Reference
- index.js:42-78 (registration)Tool registration in ListToolsRequestSchema handler — defines the 'record_action' tool name, description, and input schema.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: "record_action", description: "Record an agent action to the AgentSeal audit hash trail. " + "Call this after every significant action (sending emails, modifying files, " + "running queries, making API calls) to create a cryptographically sealed record " + "of what happened and why.", inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "Identifier for this agent (e.g. 'research-bot', 'finance-agent')", }, action_type: { type: "string", description: "What type of action was taken (e.g. 'email:send', 'file:write', 'api:call', 'db:query')", }, action_params: { type: "object", description: "Parameters of the action (e.g. {to: 'user@example.com', subject: '...'})", }, reasoning: { type: "string", description: "Why you decided to take this action — your chain of thought", }, authorized_by: { type: "string", description: "Who or what authorized this action (e.g. 'user:alice', 'policy:auto-approve')", }, }, required: ["agent_id", "action_type"], }, }, - index.js:51-77 (schema)Input schema for record_action — requires agent_id and action_type, with optional action_params, reasoning, and authorized_by.
inputSchema: { type: "object", properties: { agent_id: { type: "string", description: "Identifier for this agent (e.g. 'research-bot', 'finance-agent')", }, action_type: { type: "string", description: "What type of action was taken (e.g. 'email:send', 'file:write', 'api:call', 'db:query')", }, action_params: { type: "object", description: "Parameters of the action (e.g. {to: 'user@example.com', subject: '...'})", }, reasoning: { type: "string", description: "Why you decided to take this action — your chain of thought", }, authorized_by: { type: "string", description: "Who or what authorized this action (e.g. 'user:alice', 'policy:auto-approve')", }, }, required: ["agent_id", "action_type"], }, - index.js:127-146 (handler)Handler for record_action — sends a POST /v1/entries API call with agent_id, action_type, action_params, reasoning, and authorization, then returns the sequence and hash.
if (name === "record_action") { const result = await apiCall("POST", "/v1/entries", { agent_id: args.agent_id, action_type: args.action_type, action_params: args.action_params || {}, reasoning: args.reasoning || null, authorization: args.authorized_by ? { authorized_by: args.authorized_by } : null, }); return { content: [ { type: "text", text: `Action recorded. Sequence: ${result.sequence}, Hash: ${result.entry_hash}`, }, ], }; }