sign_action
Create signed audit records for AI agent actions to enable governance, policy enforcement, and compliance reporting through quantum-safe audit trails.
Instructions
Create a signed audit record for an AI agent action.
Args:
agent_id: The agent performing the action
action_type: Type of action (e.g. "data:read", "api:call")
action_id: Unique identifier for this action
payload: Optional JSON payload describing the action detailsInput Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_id | Yes | ||
| action_type | Yes | ||
| action_id | Yes | ||
| payload | No |
Implementation Reference
- src/asqav_mcp/server.py:63-94 (handler)The `sign_action` function is the handler for the 'sign_action' tool. It prepares a payload, sends a POST request to the Asqav API, and returns the signature result.
async def sign_action( agent_id: str, action_type: str, action_id: str, payload: str | None = None ) -> str: """Create a signed audit record for an AI agent action. Args: agent_id: The agent performing the action action_type: Type of action (e.g. "data:read", "api:call") action_id: Unique identifier for this action payload: Optional JSON payload describing the action details """ try: import json body: dict[str, Any] = { "agent_id": agent_id, "action_type": action_type, "action_id": action_id, } if payload: try: body["payload"] = json.loads(payload) except json.JSONDecodeError: body["payload"] = {"raw": payload} result = await _request("POST", "/sign", json=body) sig_id = result.get("signature_id", "unknown") algorithm = result.get("algorithm", "unknown") return f"Signed: {sig_id} (algorithm: {algorithm})" except Exception as e: return f"Error signing action: {e}" - src/asqav_mcp/server.py:62-63 (registration)The 'sign_action' tool is registered via the @mcp.tool() decorator.
@mcp.tool() async def sign_action(