Security teams should treat function calling as an attack surface, not a trusted interface. Validate that only registered tools can be invoked, reject unexpected parameter names, and test whether the model can be induced to reveal system prompts or internal instructions. Log tool requests, inspect outputs for leakage, and block any path that lets user-supplied text reshape tool schemas or permissions.
Why This Matters for Security Teams
Function calling turns an AI agent from a text generator into a system that can trigger actions, retrieve records, and chain requests across internal services. That makes validation a security gate, not a model-tuning exercise. If tool invocation is not tightly constrained, a prompt injection or malformed request can become data exposure, unauthorized workflow execution, or silent privilege escalation. Current guidance from the OWASP Agentic AI Top 10 and the NIST AI Risk Management Framework both point to the same practical issue: agents need explicit boundaries around what they may call, when, and with which inputs.
Security teams often get this wrong by testing only the model’s answer quality and not the tool layer that sits beneath it. A function call can look legitimate while still carrying attacker-controlled parameters, hidden instructions, or data exfiltration paths. In practice, many teams encounter tool abuse only after an agent has already been allowed to touch sensitive data, rather than through intentional pre-production abuse testing.
How It Works in Practice
Validation should begin with the tool registry itself. Each callable function needs an allowlist, a strict schema, and a clear sensitivity classification for the data it can reach. The agent should only be able to invoke registered tools, and the runtime should reject any request that introduces new parameters, changes expected types, or attempts to expand scope through natural-language content embedded in arguments. That control pattern is consistent with the OWASP Top 10 for Agentic Applications 2026.
Effective testing usually combines static review, red team prompts, and runtime inspection. Teams should verify that:
- Only pre-approved tools are exposed to the agent.
- Parameter names, types, and lengths are validated before execution.
- System prompts, hidden instructions, and policy text cannot be surfaced through tool output.
- Tool responses are sanitized before being passed back into the model context.
- Every request and response is logged for later review and detection.
It is also useful to test whether the agent can be coerced into calling the wrong tool with the right-looking arguments, because function-call abuse often succeeds through semantic confusion rather than obvious schema failure. For threat modeling, the MITRE ATLAS adversarial AI threat matrix helps teams map prompt injection, tool misuse, and output manipulation to concrete attack patterns.
Where sensitive data is involved, tool access should be mediated by policy decisions outside the model, ideally with separate authorization checks and data filtering before any result reaches the agent. These controls tend to break down when tools accept free-form JSON, reuse broad service credentials, or let the model assemble requests for multiple back-end systems in a single chain because the boundary between reasoning and execution becomes too loose.
Common Variations and Edge Cases
Tighter function-call validation often increases engineering overhead, requiring organisations to balance developer speed against the need for predictable agent behaviour. That tradeoff becomes sharper in environments where agents must operate across many tools, teams, or business units.
There is no universal standard for how much autonomy an agent should have at the function layer. Current guidance suggests stricter controls for any agent that can access customer data, regulated records, secrets, or administrative interfaces. For lower-risk internal workflows, some organisations permit broader tool access, but only with compensating monitoring and rollback controls. The risk is not the existence of function calling itself, but the mismatch between tool authority and the agent’s actual trust boundary.
Edge cases often appear when tool output is treated as trusted context. If a connector returns HTML, document text, or chat history, the model may follow attacker-supplied instructions embedded in that content unless the output is separated from control data. Another common failure mode is recursive tool use, where one function call triggers another without a human-visible checkpoint. In those cases, validation should include prompt-injection resistance tests, denial-of-service checks, and review of how the system handles partial failures or timeouts.
For teams building toward stronger governance, the intersection with non-human identity matters because each agent, tool, and service token should have a distinct identity and least-privilege boundary. That is where the OWASP Non-Human Identity Top 10 becomes relevant, especially when function calls are backed by shared credentials or delegated access.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10, MITRE ATLAS and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | Tool invocation and prompt injection resilience | Function calling is the primary abuse surface for agent tool misuse and schema manipulation. |
| NIST AI RMF | GOVERN | Governance is needed to define authority, oversight, and accountability for agent actions. |
| MITRE ATLAS | Prompt injection and tool abuse techniques | ATLAS maps adversarial behaviors used to coerce agents into unsafe function calls. |
| OWASP Non-Human Identity Top 10 | Identity and secret lifecycle for non-human actors | Agents often rely on service identities and shared credentials behind function calls. |
| NIST CSF 2.0 | PR.AC | Access control is central when an agent can reach sensitive data through tool calls. |
Allow only registered tools, validate arguments strictly, and red-team for injection before production access.
Related resources from NHI Mgmt Group
- How should security teams govern AI access to sensitive financial data?
- How should security teams govern AI access to sensitive data across hybrid environments?
- How should security teams govern AI agents that query sensitive data in Snowflake?
- How should security teams inventory AI agents before granting production access?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 1, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org