Apache Casbin Whitepaper: Zero Trust Authorization for AI Agents
A framework for deciding what autonomous AI agents are allowed to do. Apache Casbin (Incubating), December 2026. Download the PDF
Authorization is where agent risk is decided
Organizations are moving AI agents from pilots into production. Agents now answer customers, change code, file tickets, query databases, move money and delegate work to other agents. Each of those actions is a request to some system, and each request has to be allowed or refused by something. That something is authorization.
For human users, authorization grew up around a comfortable assumption: the person making a request meant to make it. Agents remove that assumption. An agent decides at run time which tools to call and with which arguments, and the text that shapes its decision can come from anyone: the user, a web page, an email, a shared document, the output of another tool, or another agent. A model can be wrong without any attacker involved, and it can be steered by an attacker who never touches your network. The agent does not need to break any control to cause harm. It only needs to use the access it was given.
That is why the question security leaders should ask about an agent deployment is not "is the model safe?" but "what can this agent do, for whom, and who decided?" If the honest answer is "whatever its service account can do", the deployment has a blast radius equal to that service account, and every prompt injection, every confused delegation and every wrong guess by the model is measured against it.
This paper applies Zero Trust to that question. It is written for two audiences. Security and risk leaders should read the principles and Parts I and II, which describe what is different about agents and the threats that follow. Architects and engineers should continue with Parts III to V, which give a tiered capability framework, an implementation workflow and operating practices. Throughout, short notes explain how Apache Casbin, an open-source authorization library used in Go, Java, Node.js, Python, .NET, Rust, C++, PHP and other languages, supports each capability. The framework itself does not depend on Casbin; any policy engine that can meet the requirements will do.
This paper reflects the current thinking of the Apache Casbin community. It is offered as a framework for your own evaluation, not as legal, compliance or security assurance for any particular environment.
The principles behind Zero Trust authorization
Zero Trust replaces trust based on location with trust based on verification. NIST SP 800-207, Zero Trust Architecture (2020), describes it as a set of principles in which no request is trusted because of where it comes from, every access to a resource is decided per request by a policy decision point and enforced by a policy enforcement point, and access is granted with the least privilege needed. Applied to agents, those principles become four rules for authorization.
Verify every action, not every session. A login, a connected app or an OAuth consent is not a permission to do anything for the rest of the session. Each tool call, each data retrieval and each delegation is a separate request that is authorized when it is made, with the context available at that moment.
Assume the model is compromised. Design as if the model is already following an attacker's instructions, because with prompt injection it sometimes is. Controls that rely on the model's good behavior, such as instructions in a system prompt, are guidance, not enforcement. Enforcement happens outside the model, in code the model cannot rewrite.
Grant least agency. OWASP uses least agency to extend least privilege to agents: not only which systems an agent can reach, but which actions, with which arguments, how often, and for how long. An agent that summarizes email does not need to send it. An agent that refunds orders does not need to refund every amount.
Narrow, never widen. Every step in a chain of delegation, every task boundary and every piece of untrusted input can only take permissions away. An agent never holds more authority than the person it acts for, and a sub-agent never holds more than the agent that started it.