LLM Access Control: Don't Let the AI Agent's Permission Chain Become a Data Leak Channel

The key to LLM access control isn't prompts—it's per-call authorization and default deny before tool calls execute.
The article points out that most teams mistakenly treat LLM access control as a prompt problem, constraining agents with system prompts and input moderation, while real attacks exploit the tool permissions the agent already holds. An AI agent consists of a model, a loop, and tools; every tool call is an operation against a real system, and the security boundary lies in the runtime, not in model output. Neither checking the user nor checking the prompt can block attacks—the only effective checkpoint is policy evaluation before a tool call executes. The article uses a chain of three tools—reading a document, writing a ticket, and sending a notification—to show that each step is reasonable in isolation yet the combination forms a data exfiltration path, with no exploit or jailbreak required. An effective mechanism is per-call authorization, default deny, and unified decision-making and auditing, with policy preceding execution. Monitoring logs are written after the call and cannot replace pre-execution control.
LLM Access Control: Don't Let the AI Agent's Permission Chain Become a Data Leak Channel
Most teams treat LLM access control as a prompt problem: add a system prompt saying "don't do X," wrap it in an input moderation layer, and call it done. But attacks that actually succeed rarely go through the prompt—they exploit the permissions the agent is already holding.

What Is AI Agent Security?
AI agent security is a discipline of constraint: it concerns what an LLM system can actually do once it has been given tools, credentials, and data. This is distinct from model safety—model safety governs what the model says, while agent security governs what the system executes.
An agent can be broken down into three parts: the model, the loop, and a set of tools. The model proposes actions, the runtime executes them, results return to context, and the loop continues. Every tool call is a real operation against a real system. The security boundary lives here—not in the text the model produces, but in the calls the runtime is willing to make on its behalf.
This is also why relying on prompt constraints alone doesn't work: prompts are input, not enforcement. A model trained to be helpful will use any tool you've told it about.
The Principle of Least Privilege was first articulated by Saltzer and Schroeder in 1975 and is a cornerstone of operating systems and information security: any subject should receive only the minimum privileges necessary to complete its current task, and those privileges should be revoked once the task is done. In traditional systems, this principle is implemented through process sandboxes, file permission bits, capability models, and similar mechanisms. In the LLM agent context, the difficulty is that the "current task" itself evolves dynamically—the model continuously proposes new actions within the loop, and if the permission boundary is bound to a session rather than to individual calls, it keeps expanding as the chain lengthens. Therefore, least privilege in agent security must be refined into "per-call least privilege," or an agent that initially only needed to read a single file could end up with a full set of capabilities including writing tickets and sending notifications.
Which Layer Should Access Control Live In?
The question engineers actually need to ask is narrower than "how do we do access control": where do we put the checkpoint, and what do we check?
There are three common answers, but only the last one holds up under attack.
Check the user: Authenticate the human, issue a token, and let the agent act with that token. This doesn't work, because the agent acts across multiple steps and multiple tools, while a human token is scoped for a human session—not for a chain of automated calls.
Check the prompt: Instruct the model to stay in bounds. This also doesn't work, because instructions are input, not execution. A model won't actually stay in bounds just because you said "don't cross the line."
Check the tool call: Evaluate each call against policy before it executes. This is the only approach that sits on the real boundary.
Monitoring should sit alongside the third approach, not replace it. Logs are essential for detection and forensics, but log lines are written after the call has already happened. If monitoring is your only control, your incident response is just a reading exercise.
What the Attack Surface Looks Like: A Chain of Three Tools
Imagine an agent equipped with three tools: a document reader (scoped to a folder), a ticket creator (can write to a project), and a notification sender (can reach external addresses).
Now imagine a chain: the first step reads a document, the second summarizes the content into a ticket, and the third notifies a channel. Each step looks reasonable in isolation—the failure lies in the combination.
A document sitting in the readable folder contains text that steers the summarization step, causing the agent to write content that should never have propagated. The ticket step records it, and the notification step sends it out. No tool was abused, no credential was stolen, and the model wasn't jailbroken—it simply did "helpful" things, in sequence, with the permissions it had.
This is why such attacks aren't theoretical. They don't require a novel exploit—just an agent holding broader permissions than any single step needs, and a chain long enough for combinatorial effects to emerge. And those two conditions are precisely the default state of most agent deployments.
The same pattern applies to any tool that can read combined with any tool that can write. Read plus write plus a loop equals a data exfiltration path—unless something interrupts it.
The Blocking Mechanism: Per-Call Authorization and Least Privilege
The mechanism is: enforce per-call authorization at the tool boundary and apply the principle of least privilege. Specifically, this has three properties.
Permissions attach to the call, not the session. The agent doesn't carry a broad authorization through the entire chain. Each tool call is evaluated against what that call is allowed to do at the current step, with the current data.
Default deny. Tools not explicitly granted for this call do not execute. This inverts the common model—where the agent had a toolbox and policy was a set of prohibitions—into allowlist-style authorization.
The decision is made before execution and recorded alongside the call. The policy check and the audit record are the same event, so what you monitor is what you actually enforce—not two data streams that need reconciliation.
Order matters: policy first, execution second, and logging as part of the decision. If logs are written after the tool has already run, you have monitoring, not control.
According to RESK's official documentation, its reskSecure component enforces least privilege on agent tool calls, evaluating each call against policy before execution with default deny, and binding authorization scope to the call itself; ReskPoints provides the enforcement point, placing the check at the boundary between the agent runtime and the tools, rather than being a sidecar component that observes traffic after the fact. Together, they implement exactly the order described above: policy decision, execution, and an audit record that reflects the actual execution decision.
Migration Checklist: From Prompts to Policy
If you currently rely on "prompt instructions + logs," the gap is the window between when a call is proposed and when it is executed. That's where the control belongs.
- List every tool the agent can call, and the permission scope each step actually needs.
- Remove standing authorizations and bind permissions to the call, not the session.
- By default, deny any tool not explicitly authorized for the current call.
- Evaluate policy before execution, not after.
- Make the audit record part of the policy decision, so monitoring reflects execution.
- Treat "read + write + loop" as an exfiltration path until proven otherwise.
- Review chains, not just individual tools—permission creep often shows up in combinations.
- Test with a document that attempts to steer the chain, and confirm the call is blocked, not merely logged.
The core of AI agent security isn't making the model more "obedient"—it's ensuring the runtime doesn't overstep on any tool call. Prompts handle intent; policy handles boundaries—neither can substitute for the other.
Background Notes
Policy Enforcement Point (PEP) and Policy Decision Point (PDP) are a pair of concepts from classic access control architectures (such as XACML and the NIST Zero Trust Reference Architecture): the PDP is responsible for making allow-or-deny judgments based on policy, and the PEP is responsible for intercepting requests at the real resource boundary and enforcing that judgment. Mapping this model to the agent runtime, the check before a tool call executes is the PEP, and the policy engine is the PDP. The key is that the PEP must sit on the mandatory path between the agent runtime and the tools—it cannot be a side-channel observer, because side-channel logs or traffic mirrors cannot block a call in progress. In addition, the decision outcome must be written back as an audit event, to guarantee that "what was executed" and "what was recorded" are the same fact.
Indirect Prompt Injection is a common trigger for this kind of chain attack: rather than conversing with the model directly, the attacker hides malicious instructions in external content the agent will read—documents, web pages, emails, ticket descriptions. When the agent reads this content, the text within becomes part of the context and may steer subsequent steps toward actions the attacker wants. The difference from direct prompt injection is that the attack surface expands from conversational input to every data source the agent touches. On defense, input filtering alone struggles to be exhaustive, since legitimate documents can naturally embed seemingly reasonable instructions; a more reliable approach is to accept that "content that gets read is untrusted" and restrict, at the tool-call boundary, which follow-up operations such content can trigger.
Default Deny and allowlist-style authorization are another fundamental principle of secure design: deny everything not explicitly allowed, rather than listing prohibited items and permitting the rest. The problem with the latter is that prohibition lists are never complete—an attacker only needs to find a path that isn't listed. For agents, default deny means tools are not "available by default, disabled on demand" but "unavailable by default, explicitly authorized per call." This requires, at deployment time, first enumerating the least privilege each tool needs at each step, and accepting the behavioral change of "unauthorized means failure"—the agent may therefore refuse some actions it could previously complete, but that is precisely the boundary doing its job. Unifying audit records with policy decisions ensures that both denials and allowances leave a traceable basis, making it easier to review after the fact whether policies are too broad or too narrow.
One-line Summary
The key to LLM access control isn't prompts—it's per-call authorization and default deny before tool calls execute.
Paragraph Summary
The article points out that most teams mistakenly treat LLM access control as a prompt problem, constraining agents with system prompts and input moderation, while real attacks exploit the tool permissions the agent already holds. An AI agent consists of a model, a loop, and tools; every tool call is an operation against a real system, and the security boundary lies in the runtime, not in model output. Neither checking the user nor checking the prompt can block attacks—the only effective checkpoint is policy evaluation before a tool call executes. The article uses a chain of three tools—reading a document, writing a ticket, and sending a notification—to show that each step is reasonable in isolation yet the combination forms a data exfiltration path, with no exploit or jailbreak required. An effective mechanism is per-call authorization, default deny, and unified decision-making and auditing, with policy preceding execution. Monitoring logs are written after the call and cannot replace pre-execution control.
Related articles

Cursor AI Programming in Practice: Build a Student Management System from Scratch in 30 Minutes
A Bilibili creator demonstrates Cursor AI programming: generating a student management system in 30 minutes with natural language. Details on Agent mode, Claude selection, prompt techniques, and thresholds.

Top 20 AI Coding Tools Ranking: From Rock-Solid to Lackluster, a Scored Matrix
Bilibili creator releases top 20 AI coding tools ranking, tiered T0–T4 from rock-solid to lackluster, with Claude Code and Codex tied at T0. This article details the scoring dimensions (capability, reliability, robustness, durability, cost, domestic availability) and tool performances to help developers choose the right AI coding assistant.

Vibe Coding Systematic Tutorial: Master AI-Assisted Programming from Zero
A three-month Vibe Coding tutorial from a Bilibili creator covering Codex, ClaudeCode, and Cursor, from core logic to commercial project practice for beginners.