> ## Documentation Index
> Fetch the complete documentation index at: https://openfga.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Agent Authorization

> Authorize AI agents with OpenFGA. Model agents as principals, delegate user permissions, and enforce least privilege for autonomous and copilot agents.

Autonomous and copilot agents act on behalf of users — but "on behalf of" is not the same as "as." A well-modeled agent has its **own identity**, inherits **only the permissions it actually needs**, and can be revoked independently of the user it serves.

OpenFGA models this directly:

* **Agents are first-class principals.** They appear on the left side of tuples like users do, so checks, list-objects, and list-users all work on agent identities.
* **Permissions are delegated, not copied.** Relations like `can_act_on_behalf_of` make the delegation explicit and revocable.
* **Scope is bounded.** An agent can be granted access to a specific workspace, document set, or tool — not the user's entire footprint.

## The modeling pieces

The modeling guides below cover the building blocks:

* [Agents as principals](/docs/modeling/agents/agents-as-principals) — define an `agent` type and use it like a user.
* [Task-based authorization](/docs/modeling/agents/task-based-authorization) — bound an agent to a single task or session.
* [RAG authorization](/docs/use-cases/rag-authorization) — filter retrieved context by the user's permissions before the model sees it.
* [MCP server authorization](/docs/use-cases/mcp-server-authorization) — protect tools and resources exposed via Model Context Protocol.

## Why ReBAC fits agent workflows

Agent workflows are graph-shaped: a user grants an agent access to a workspace; the workspace contains documents; some documents are shared from other workspaces. Roles can't model that without exploding into per-resource role definitions. Relationships do it natively — and OpenFGA's [reverse queries](/docs/interacting/relationship-queries) (`list-objects`, `list-users`) let the agent ask *"what can I see?"* without scanning everything.

## Related reading

* [Authorization for AI Agents](/docs/modeling/agents) — the full modeling guide, with examples.
* [Policy vs Relationship Engines](/docs/learn/policy-engine) — when relationship modeling is the right tool for agent workflows.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.