Home · AI Security Answers · Agent controls & hardening
How do I build an allow-list of approved tools, APIs, and domains for an AI agent?
To build an allow-list for an AI agent, define and enforce explicit lists of approved domains, tools, and APIs, ensuring that any attempt to access resources outside these lists is rejected. This approach helps mitigate risks such as unsafe external API interactions and privilege escalation through delegation.
Here are concrete controls for building an allow-list:
- Define Allowed Domains: Implement a whitelist of logical filesystem domains that the agent is permitted to operate within, mapping each to an immutable canonical root path. This whitelist should be part of the class body to prevent runtime modification and should reject any string outside the defined set before path resolution. This addresses the OWASP LLM Top 10 risk of LLM07: Insecure Plugin Design by restricting the agent's operational scope.
- Canonicalize Paths: At registration time, canonicalize every domain root using
Path.resolve(strict=True)to follow symlinks and normalize the path. This ensures that the physical path is captured before any potential symlink swaps, preventing an attacker from redirecting future access. This contributes to the NIST AI RMF function of Protect by establishing a secure baseline for file system access. - Implement Approval Scopes: Utilize approval mechanisms with different scopes, such as session-based (in-memory) and permanent (persisted to a configuration file) approvals for patterns or actions. This allows for granular control over what an agent is permitted to do, addressing the OWASP LLM Top 10 risk of LLM07: Insecure Plugin Design by requiring explicit approval for actions.
- Normalize Tool Intents: Employ an Intent-Based Access Control (IBAC) layer to normalize heterogeneous tool calls from various agent runtimes into canonical actions (e.g.,
read,write,execute). This enables a single policy set to govern all agent runtimes, ensuring consistent security standards and providing granular control based on agent identity, environment, resource context, and time-based rules. This aligns with the NIST AI RMF function of Govern by establishing a unified policy enforcement mechanism. - Tool-Call Validation Gates: Implement validation gates for tool calls, including schema validation, allowlisted tools/actions, and parameter constraints. Schema validation on every call is a cost-effective and efficient check, as agents under prompt injection often produce malformed responses, and refusing to proceed on schema violation can interrupt many attacks. This directly mitigates the OWASP LLM Top 10 risk of LLM07: Insecure Plugin Design and LLM01: Prompt Injection.
- Deny-by-Default Access: Adopt a deny-by-default access policy for external systems. This means that unless explicitly allowlisted and approved, an agent should not be able to interact with external APIs or services, thereby reducing the attack surface. This aligns with the NIST AI RMF function of Protect by minimizing unauthorized access.
Grounded in
- Chapter 4: Working Directory & File-Path Resolution (Claude Code vs. Hermes Agent)
- Chapter 4: Permission Systems and Safety Guardrails (Claude Code vs. Hermes Agent)
- Claude Agents Can Now Dream: How AI Engineers Should Use Anthropic’s New Agent Features Without Creating New Attack Paths
- Designing Agentic AI Systems with the ORCHIDEAS Framework
- How to Discover Shadow AI Agents in Your Enterprise
- Intent-Based Access Control(IBAC) for Coding Agents
How does your AI agent score?
Get a free, instant AI agent security readiness snapshot — mapped to NIST, OWASP & ISO — then unlock the full report with a prioritized, cited fix-list.
This AI-generated answer is for guidance only — not a certification, audit, or penetration test. Grounded in the NIST AI RMF, OWASP LLM Top 10, and ISO/IEC 42001 control text; verify applicability to your environment.