AID-D-003.003: Agentic Tool Use & Action Policy Monitoring
Pillars: app
Lifecycle: operation
Scope boundary
Owns detective monitoring of individual tool-action enforcement outcomes, parameter failures, policy denies, and abnormal decision bursts. It does not define capability scope, authorize an action, or execute a tool.
AID-D-003.004: AID-D-003.003 evaluates telemetry about each individual tool decision; AID-D-003.004 detects risk emerging from the order and composition of otherwise valid or invalid tool calls. A series can be suspicious even when each action is individually allowed, and one denied action does not establish a sequence anomaly.
AID-H-018.002: AID-D-003.003 monitors the decisions and failures emitted by runtime authorization; AID-H-018.002 evaluates policy and returns the canonical allow or deny result. The detector must observe enforcement outcomes without becoming a second authorization engine.
Implementation guidance
- AID-D-003.003-G001: Consume and log tool-parameter validation failures from the enforcement layer before execution.
- AID-D-003.003-G002: Log every tool decision (allowed and denied) to a central SIEM for audit and alerting.
AID-D-003.003-G001
Concept:
Strict tool-parameter schema validation should be implemented by the enforcement layer defined in AID-H-018.001. This strategy focuses on the detection/monitoring side: capturing validation failures, denied executions, and suspicious parameter patterns so they become auditable security events.
Detection-Oriented Handling
When the schema enforcement layer rejects malformed, out-of-range, or policy-incompatible parameters, record the attempted tool name, calling agent identity, reason for failure, and relevant sanitized metadata. These events should be forwarded to SIEM/SOAR pipelines for alerting, trend analysis, and incident investigation.
{
"event_type": "tool_parameter_validation_failure",
"agent_id": "spiffe://prod.example/agent/order-assistant",
"tool_name": "payments.create_refund",
"reason": "schema_validation_failed",
"details": {"field": "amount", "error": "maximum_exceeded", "schema_version": "payments-tool.v4"}
}
Action: Keep strict schema enforcement in AID-H-018.001. In this strategy, instrument monitoring so every validation failure or denied tool invocation becomes a structured, searchable security event before execution is allowed to proceed.
Verify safely
An independent verifier must fetch proposals and validation results independently, join them by immutable call ID, revalidate parameters against the signed schema and policy, and compare failure reasons and population gaps, read evidence back, verify signatures and digests, and compare the canonical result digest.
AID-D-003.003-G002
Consume an authoritative decision receipt
The logger must observe the policy-enforcement result; it must not let an agent or request body choose ALLOWED or DENIED. Configure the receipt verifier and append-only sink at process startup. The verifier is an adapter to the policy engine's trust registry and returns a typed receipt only after checking its signature, freshness, policy version, and proposal/action digest.
Validate, minimize, and append one terminal event
from __future__ import annotations
# File: agents/tool_decision_logging.py
import hashlib
import json
from collections.abc import Callable
from dataclasses import asdict, dataclass
from typing import Literal
Decision = Literal["ALLOWED", "DENIED"]
@dataclass(frozen=True)
class VerifiedToolDecision:
decision_id: str
proposal_id: str
tool_call_id: str
tenant_id: str
authenticated_principal_id: str
agent_id: str
tool_name: str
action_sha256: str
decision: Decision
reason_code: str
policy_id: str
policy_version: str
decided_at: str
verifier_id: str
receipt_sha256: str
VerifyReceipt = Callable[[bytes], VerifiedToolDecision]
AppendEvent = Callable[[dict], str]
def emit_tool_decision(
*,
signed_receipt: bytes,
expected_proposal_id: str,
expected_action_sha256: str,
verify_receipt: VerifyReceipt,
append_event: AppendEvent,
) -> dict:
receipt = verify_receipt(signed_receipt)
required = (
receipt.decision_id, receipt.proposal_id, receipt.tool_call_id,
receipt.tenant_id, receipt.authenticated_principal_id, receipt.agent_id,
receipt.tool_name, receipt.action_sha256, receipt.reason_code,
receipt.policy_id, receipt.policy_version, receipt.decided_at,
receipt.verifier_id, receipt.receipt_sha256,
)
if not all(required) or receipt.decision not in ("ALLOWED", "DENIED"):
raise ValueError("verified tool-decision receipt is incomplete")
if receipt.proposal_id != expected_proposal_id or receipt.action_sha256 != expected_action_sha256:
raise ValueError("tool decision is bound to another proposal or action")
if len(receipt.action_sha256) != 64 or len(receipt.receipt_sha256) != 64:
raise ValueError("tool-decision digest is malformed")
event = {
"schema_version": "aidefend.agent_tool_decision.v2",
"event_type": "agent_tool_decision",
**asdict(receipt),
}
event_bytes = json.dumps(
event, sort_keys=True, separators=(",", ":"), allow_nan=False
).encode("utf-8")
event["event_sha256"] = hashlib.sha256(event_bytes).hexdigest()
acknowledgement_id = append_event(event)
if not acknowledgement_id:
raise RuntimeError("append-only decision sink did not acknowledge the event")
return {
"decision_id": receipt.decision_id,
"event_sha256": event["event_sha256"],
"acknowledgement_id": acknowledgement_id,
}Detect denial bursts without inventing a global threshold
Render the SIEM rule from signed environment policy using tenant_id, authenticated principal, agent, tool, event-time window, minimum denial count, and minimum distinct proposal count. Count unique decision_id values and require the exact proposal-to-terminal-decision population; missing or duplicate terminal receipts are telemetry defects, not low activity. Read events back by decision ID and compare the policy receipt digest before publishing a burst finding. This guidance logs and detects decisions; tool authorization and execution remain at their enforcement points.
Open-source tools
- Open Policy Agent (OPA)
- Pydantic
- LangChain
- Microsoft Agent Framework
- CrewAI
- Ajv
- python-jsonschema
- Langfuse (tool-call trace and policy-outcome telemetry; enforcement remains external)
Commercial / hosted tools
- Check Point AI Guardrails
- Palo Alto Networks Prisma AIRS
- Cerbos Hub
- Permit.io
- Kong Konnect
- Google Cloud Apigee API Management
Threat mappings
MITRE ATLAS
- AML.T0053 AI Agent Tool Invocation
- AML.T0048 External Harms
- AML.T0048.000 External Harms: Financial Harm (denied or anomalous payment decisions surface unauthorized attempts)
- AML.T0086 Exfiltration via AI Agent Tool Invocation
- AML.T0051 LLM Prompt Injection (denied tool decisions reveal injection-driven action attempts)
- AML.T0051.001 LLM Prompt Injection: Indirect (denied tool decisions reveal indirect-injection-driven action attempts)
- AML.T0051.002 LLM Prompt Injection: Triggered
- AML.T0084 Discover AI Agent Configuration (deny and schema-failure patterns reveal probing of tool definitions)
- AML.T0084.001 Discover AI Agent Configuration: Tool Definitions
- AML.T0098 AI Agent Tool Credential Harvesting (decision telemetry reveals denied credential-access attempts)
- AML.T0102 Generate Malicious Commands (decision telemetry surfaces malicious command proposals)
- AML.T0085 Data from AI Services (decision telemetry surfaces unauthorized AI-service data requests)
- AML.T0085.001 Data from AI Services: AI Agent Tools (decision telemetry surfaces unauthorized tool-mediated data requests)
- AML.T0084.002 Discover AI Agent Configuration: Activation Triggers (deny patterns reveal activation-trigger probing)
MAESTRO
- Agent Goal Manipulation (L7)
- Agent Tool Misuse (L7)
- Privilege Escalation (Cross-Layer) (decision telemetry surfaces tool-based privilege-escalation attempts)
- Integration Risks (L7) (decision telemetry observes abuse at tool integration points)
- Compromised Agents (L7) (abnormal decision patterns can reveal compromised-agent tool use)
OWASP LLM Top 10 2026
- LLM03:2026 Excessive Agency
- LLM10:2026 Improper Output Handling (parameter-schema failure telemetry detects unsafe model-generated tool calls at the enforcement boundary)
OWASP ML Top 10 2023
- N/A
OWASP Top 10 for Agentic Applications 2026
- ASI01:2026 Agent Goal Hijack
- ASI02:2026 Tool Misuse and Exploitation
- ASI03:2026 Identity and Privilege Abuse
- ASI05:2026 Unexpected Code Execution (RCE)
- ASI10:2026 Rogue Agents
- ASI08:2026 Cascading Failures (denied or abnormal action chains reveal cascading tool misuse)
NIST Adversarial Machine Learning 2025
- NISTAML.018 Prompt Injection (denied tool decisions reveal injection-driven action attempts)
- NISTAML.015 Indirect Prompt Injection (denied tool decisions reveal indirect-injection-driven action attempts)
- NISTAML.039 Compromising connected resources
Cisco Integrated AI Security and Safety Framework
- AISubtech-12.1.1 Parameter Manipulation (parameter-policy rejection patterns in verified tool receipts)
- AITech-12.1 Tool Exploitation (parameter-policy rejection patterns in verified tool receipts)
Google Secure AI Framework 2.0 - Risks
- RA: Rogue Actions
- PIJ: Prompt Injection (denied tool decisions reveal injection-driven action attempts)
Databricks AI Security Framework 3.0
- Model Serving - Inference requests 9.13: Excessive agency
- Agents - Core 13.2: Tool Misuse
- Agents - Core 13.3: Privilege Compromise
- Agents - Core 13.6: Intent Breaking & Goal Manipulation
- Agents - Tools MCP Server 13.23: Data Exfiltration (decision telemetry surfaces tool-mediated exfiltration attempts)