What Is Attribute-Based Access Control (ABAC)?
ABAC decides every request from facts: who is calling, what they want, and under what conditions. This guide explains how ABAC works, which attributes you can trust, how policies resolve conflicts, and how to use it to keep each API consumer inside its own data, with tested policy examples.

TL;DR:
What is attribute-based access control (ABAC)?
Attribute-based access control (ABAC) is an access control model that decides each request by checking attributes against a policy. Attributes describe the user or app (tenant, plan, department), the resource (owner, data class), the action (read, export) and the context (time, network, environment).
If the attributes satisfy the policy, access is granted; otherwise it is denied.
A partner's app sends GET /orders/4711. It has a valid token and the orders:read scope. Order 4711 belongs to a different customer. A role check passes: the app is a partner with read access. An attribute check fails: the app's tenant isn't the order's tenant.
That gap between "this caller may read orders" and "this caller may read this order" is what attribute-based access control closes. It's also the gap behind the most common API vulnerability. The OWASP API Security Top 10 has ranked Broken Object Level Authorization first in both its 2019 and 2023 editions.
This guide explains what ABAC is, how a decision is made step by step, which attributes you can trust, and how to write ABAC policies, with examples we ran and tested.

What is attribute-based access control (ABAC)?
ABAC grants or denies access by evaluating attributes of the request against rules, instead of checking a fixed list of permissions. The rule says what must be true. The attributes say what is true right now.
Attribute-based access control (ABAC)
Attribute-based access control is a logical access control method in which authorization is determined by evaluating attributes associated with the subject, the object, the requested operation and, in some cases, the environment against policy, rules or relationships. This is how NIST defines it in SP 800-162 (January 2014, updated 2019).
In plain terms, the ABAC meaning comes down to one sentence: access depends on facts, not on a name. Instead of "Alice is an analyst, analysts can read reports", an ABAC rule says "a user can read a report if they're in the same department as the report, the report isn't classified above their clearance, and they're on a managed device".
Here is an ABAC example for an orders API, written in plain language:
- Allow a consumer to read an order if the consumer's tenant equals the order's tenant and the consumer's token has the
orders:readscope. - Allow a consumer to export orders if the tenants match, the token has
orders:export, and the consumer is on the enterprise plan. - Deny any access to orders marked as personal data unless the request comes from an allowlisted network.
Three rules cover every tenant, every plan and every new customer you add. With roles, you'd need a role per tenant, per plan and per network.
What are the four types of attributes in ABAC?
ABAC uses subject, resource, action and environment attributes. Every rule combines some of these four.
The four types of ABAC attributes
| Attribute type | Describes | Examples | Typical source |
|---|---|---|---|
| Subject | Who or what is calling | Tenant, plan, department, clearance, app type, scopes | Identity provider, token claims, HR or CRM |
| Resource (object) | What is being accessed | Owner, tenant, data class, region, sensitivity, API group | The resource record, API catalog, data catalog |
| Action | What the caller wants to do | Read, write, delete, export, approve | The request method and route |
| Environment (context) | The conditions of the request | Time, source IP, device trust, environment, risk score | The gateway, network and threat signals |
Swipe sideways to see all columns →
How does ABAC work?
An ABAC system intercepts each request, gathers the attributes it needs, evaluates them against policy, and enforces the result. Four components share the work. NIST SP 800-162 and the OASIS XACML standard use the same names.

Here is how a single ABAC access control decision happens:
- The request arrives at the policy enforcement point (PEP). For APIs, this is usually the API gateway or a middleware in the service. The PEP never decides. It only asks and enforces.
- The PEP builds an authorization request. It includes the subject (from the verified token), the action (method and route), the resource (the API or object ID) and the context (time, IP, environment).
- The policy decision point (PDP) evaluates the request. The PDP is the policy engine, such as Cedar, Open Policy Agent (OPA) or an XACML engine. It finds the policies that apply.
- The PDP fetches missing attributes from policy information points (PIPs). A PIP is any trusted source: the user directory, the billing system, the data catalog. The token may say who the caller is, but not which plan they're on today.
- The PDP returns allow or deny. It can also return obligations, such as "log this access" or "mask the email field".
- The PEP enforces the decision. It forwards the request or returns
403 Forbidden. If the PDP is unreachable or errors, the PEP denies. That's called failing closed.
The fourth component, the policy administration point (PAP), is where people write, review, test and version policies. Treat it like a code repository, because that's what it should be.
How does ABAC resolve conflicting rules?
When several rules match, a combining algorithm decides the outcome, and the safe default is that any deny wins. Competitor guides rarely cover this, but it's where many ABAC bugs live.
- Deny-overrides: if any matching rule denies, the result is deny. Cedar works this way: a
forbidalways beats apermit. - Permit-overrides: if any matching rule permits, the result is permit. Useful for break-glass access, risky as a default.
- First-applicable: the first matching rule in order decides. Simple, but reordering rules changes access.
- Default deny: if no rule matches, the answer is deny. Every ABAC system should start here.
XACML 3.0 (OASIS, 2013) defines these algorithms formally. Cedar and OPA build deny-by-default and deny-overrides into the language or the policy pattern.
How do you write an ABAC policy?
An ABAC policy has three parts: who and what it applies to, the condition on attributes, and the effect (allow or deny). Most policy languages follow the same shape.
Here is the orders example from above as a real ABAC policy in Cedar, the open-source language behind Amazon Verified Permissions:
// 1. Read: same tenant + the right scope
permit (principal is Consumer, action == Action::"read", resource is Order)
when {
principal.tenant == resource.tenant &&
principal.scopes.contains("orders:read")
};
// 2. Export: same tenant + export scope + enterprise plan
permit (principal is Consumer, action == Action::"export", resource is Order)
when {
principal.tenant == resource.tenant &&
principal.scopes.contains("orders:export") &&
principal.plan == "enterprise"
};
// 3. Guardrail: personal data only from allowlisted networks
forbid (principal, action, resource)
when { resource.dataClass == "pii" && !context.ipAllowlisted };We ran this policy through Cedar 4.15 against seven requests:
ABAC policy test results (Cedar 4.15)
| Request | Attributes that matter | Decision | Why |
|---|---|---|---|
| ACME's ERP app reads ACME order 4711 | Same tenant, has orders:read | Allow | Rule 1 matches |
| Globex's app reads ACME order 4711 | Different tenant | Deny | No rule permits it: the BOLA attempt fails |
| ACME's mobile app reads order 4711 | Same tenant, no scope | Deny | Scope missing |
| ACME's BI app exports orders | Same tenant, standard plan | Deny | Export needs the enterprise plan |
| ACME's ERP app exports orders | Same tenant, enterprise plan | Allow | Rule 2 matches |
| ACME's ERP app reads a PII order from an unknown network | Not allowlisted | Deny | Rule 3 forbid wins over rule 1 |
| ACME's ERP app reads a PII order from the office network | Allowlisted | Allow | Rule 1 matches, no forbid applies |
Swipe sideways to see all columns →

How do you catch mistakes in ABAC policies?
Validate every policy against a schema before it ships. A typo in an attribute name doesn't crash an ABAC policy. It silently stops matching, and access breaks or opens in ways nobody notices.
Cedar lets you declare the attributes each entity has:
entity Consumer = { tenant: String, plan: String, scopes: Set };
entity Order = { tenant: String, dataClass: String };
action read, export appliesTo {
principal: Consumer,
resource: Order,
context: { ipAllowlisted: Bool }
}; When we changed principal.tenant to principal.tenat in rule 1, Cedar's validator rejected the policy with "attribute tenat on entity type Consumer not found". Run that check in CI, next to unit tests that replay known requests like the table above.
What does ABAC look like in AWS IAM?
In AWS, ABAC means comparing tags on the caller with tags on the resource. The AWS ABAC guide uses this pattern to let one policy cover every project, instead of one policy per project:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadSecretsOfMyProject",
"Effect": "Allow",
"Action": "secretsmanager:GetSecretValue",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/project": "${aws:PrincipalTag/project}"
}
}
},
{
"Sid": "NobodyRetagsTheProjectTag",
"Effect": "Deny",
"Action": ["secretsmanager:TagResource", "secretsmanager:UntagResource"],
"Resource": "*",
"Condition": {
"ForAnyValue:StringEquals": { "aws:TagKeys": ["project"] }
}
}
]
}The second statement matters as much as the first. If people can change the project tag on a secret, they can change who can read it. In ABAC, whoever controls an attribute controls access.
Which ABAC policy languages can you use?
ABAC policy languages compared
| Language or engine | Style | Where it fits | Notes |
|---|---|---|---|
| XACML (OASIS) | XML policies, full PEP/PDP/PIP/PAP model | Large enterprises, government, legacy IAM suites | The original ABAC standard; verbose |
| Rego (Open Policy Agent) | Declarative rules over JSON input | Kubernetes, microservices, API gateways | CNCF graduated project; general-purpose |
| Cedar (AWS, open source) | Permit/forbid policies with a schema | Application and API authorization | Built-in validation; forbid overrides permit |
| AWS IAM conditions | JSON conditions on tags and request keys | AWS resources | ABAC through aws:PrincipalTag and aws:ResourceTag |
| Azure ABAC | Conditions on role assignments | Azure Storage and other Azure resources | Adds attribute conditions to Azure RBAC |
Swipe sideways to see all columns →
Which attributes can you trust?
Trust an attribute only as much as you trust whoever set it. This is the part of ABAC most guides skip, and it's the part attackers aim at.

Rank attributes by source:
- Trusted: claims inside a verified, signed token (
sub,tenant,scope), attributes your gateway or service looks up from a system of record (billing plan, data catalog), and context the gateway measures itself (source IP, its own environment). - Trusted with care: attributes that can go stale, such as a cached plan or a department copied into a token hours ago. Keep cache lifetimes short and update on change events.
- Never trusted on their own: anything the client sends in a header, query string or body, such as
X-Tenant: acmeor?region=eu. Use them only after checking them against a trusted source.
Two rules follow. First, protect who can write each attribute: tags, directory fields and catalog labels need their own access control, as the AWS example shows. Second, decide what happens when a PIP is down. The safe answer is deny, with clear alerts.
What is the difference between ABAC and RBAC?
RBAC grants access through roles; ABAC grants access by evaluating attributes and context on each request. RBAC is simpler to run and audit. ABAC is more precise and avoids "role explosion", where every new condition becomes a new role.
ABAC vs RBAC at a glance
| RBAC | ABAC | |
|---|---|---|
| Decides by | Role membership | Subject, resource, action and environment attributes |
| Example | Partners can read orders | Partners can read orders of their own tenant, from allowlisted networks |
| Granularity | Per role | Per request and per object |
| Audit | Easy: list role members | Harder: needs decision logs |
Swipe sideways to see all columns →
Most teams don't choose one. They use roles for broad access and ABAC rules for the fine-grained checks. For the full side-by-side test of both models, see RBAC vs ABAC.
What are the advantages and disadvantages of ABAC?
ABAC is precise, context-aware and scales without new roles, but it needs accurate attributes, careful policy design and good logging. Weigh both before you commit.
Advantages and disadvantages of ABAC
| Advantages | Disadvantages |
|---|---|
| Fine-grained: decisions per request and per object, not per role | Attribute quality is critical: wrong or stale attributes give wrong answers |
| Context-aware: time, network, device and risk can change the answer | Harder to audit: "who can access X?" depends on attribute values |
| Fewer policies: one rule covers every tenant, project or region | Policy design takes skill: rules can interact in surprising ways |
| No role explosion: new customers and plans are data changes | More moving parts: PDP, PIPs and caches must be fast and available |
| Supports least privilege: narrow access without hundreds of roles | Latency: attribute lookups add time unless cached |
Swipe sideways to see all columns →
The over-permissioning ABAC targets is real. Microsoft's 2023 State of Cloud Permissions Risks report found identities used only 1% of the permissions they were granted, and more than 50% of identities were super admins.
How does ABAC work for API access?
For APIs, ABAC answers the question roles can't: may this consumer touch this specific object, right now? The gateway checks attributes that apply to whole APIs. The service checks attributes that need the object itself, such as its owner or tenant.
That second check is the one most APIs miss. The OWASP API Security Top 10 (2023) ranks Broken Object Level Authorization (BOLA) first: an API returns an object without checking that the caller owns it. ABAC's tenant rule, principal.tenant == resource.tenant, is the fix in one line. And the risk doesn't come from anonymous attackers. Salt Security's 2025 State of API Security report found that 95% of API attacks came from authenticated sources.
Where each ABAC check belongs for an API:
Where to enforce each ABAC check for an API
| Check | Attributes used | Where to enforce |
|---|---|---|
| Can this consumer call this API at all? | Plan, partner tier, API group, environment | API gateway |
| Is this action allowed for this consumer? | Token scopes, method and route | API gateway |
| Is this request allowed right now? | Source IP, time, rate, risk score | API gateway |
| Does this consumer own this object? | Consumer tenant, object tenant or owner | Service (or gateway with a lookup) |
| Can this field be returned? | Data class, consumer clearance or contract | Service, or response filtering at the gateway |
Swipe sideways to see all columns →
Most API attributes already exist. The verified token carries the consumer ID, tenant and scopes; read more in what is a JWT. The developer portal knows each consumer's plan and approved APIs. The API catalog knows each API's owner, data class and lifecycle stage. ABAC connects them into one decision.
The hard part is consistency. When APIs sit behind Kong, Apigee, AWS API Gateway and an AI gateway, each one gets its own version of the rules. The DigitalAPI API Gateway applies one attribute-based policy across the gateways you already run, so a rule like "PII only from allowlisted networks" changes once. Teams using the DigitalAPI API Developer Portal keep plan, team and API-group attributes in one place, so consumers get access scoped by those attributes from day one.
See how DigitalAPI applies attribute-based access rules across every gateway you run → Book a Demo
How does ABAC work for AI agents?
Give each AI agent its own identity, then use attributes to limit which tools, tenants and data classes it can reach on each call. An agent working for one customer should carry that customer's tenant as an attribute and be denied everything else.
Useful agent attributes: the agent's own ID, the tenant or user it acts for, allowed tools, data classes it may read, and whether a human approved the current action. The MCP authorization specification requires MCP servers to accept only tokens issued for them, which is an audience attribute check. For the full setup, see securing MCP endpoints.
How do you implement ABAC?
Start small: pick one high-risk API, define its attributes, write a few rules, and run them in log-only mode before you enforce. Here's a sequence that works:
- Pick one decision to fix first. Tenant isolation on your most sensitive API is usually the best start.
- List the attributes that decision needs and name the system of record for each one.
- Get attributes into the request path. Put stable ones in token claims; fetch changing ones from a PIP with a short cache.
- Lock down who can change attributes. Tags, catalog labels and plan fields need their own access control.
- Write policies in a policy language, not in application
ifstatements, and validate them against a schema. - Default deny and fail closed. No matching rule, or a policy error, means
403. - Test with recorded requests. Keep a table of known requests and expected decisions, and run it in CI.
- Run new rules in log-only mode first, compare with current behaviour, then enforce.
- Log every decision with the policy ID and key attributes, so you can answer auditors.
- Review attributes and policies on a schedule, the same way you review roles.
Key takeaways
- Attribute-based access control decides each request from attributes of the subject, resource, action and environment.
- Four components do the work: the PEP enforces, the PDP decides, PIPs supply attributes and the PAP manages policies.
- Deny should win: use deny-overrides, default deny and fail closed.
- Whoever controls an attribute controls access, so protect attribute sources and never trust client-supplied values.
- For APIs, ABAC fixes what roles can't: per-object checks such as tenant isolation, the fix for OWASP API1.
Frequently asked questions
1. What is ABAC in simple terms?
ABAC, or attribute-based access control, decides access by checking facts about a request against rules. The facts are attributes of the user or app, the resource, the action and the context, such as tenant, data class or time. If the attributes satisfy the rule, access is allowed. If not, it's denied.
2. What is an example of attribute-based access control?
A common ABAC example is tenant isolation in a SaaS API: a consumer may read an order only if the consumer's tenant matches the order's tenant and its token has the orders:read scope. Another is a hospital rule letting a doctor view a record only for patients in their own ward during their shift.
3. What are the four attributes of ABAC?
ABAC uses four categories of attributes: subject attributes (who is calling, such as department or tenant), resource attributes (what is being accessed, such as owner or data class), action attributes (what the caller wants to do, such as read or export) and environment attributes (conditions such as time, location or network).
4. What is the difference between ABAC and RBAC?
RBAC grants access based on the roles a user holds. ABAC grants access by evaluating attributes of the user, resource, action and context on each request. RBAC is simpler to manage and audit; ABAC is more precise and avoids creating a new role for every condition. Many systems combine both.
5. Is ABAC better than RBAC?
ABAC is more flexible and fine-grained, but not better in every case. It needs accurate attributes, careful policy design and decision logging. RBAC is often enough for stable, coarse access. Most organisations use roles for broad access and add ABAC rules where access depends on data, tenant or context.
6. What is a policy decision point in ABAC?
The policy decision point (PDP) is the component that evaluates ABAC policies and returns allow or deny. It receives requests from the policy enforcement point, such as an API gateway, fetches missing attributes from policy information points, and applies the policy combining rules. Cedar, OPA and XACML engines all act as PDPs.
7. What is XACML?
XACML (eXtensible Access Control Markup Language) is an OASIS standard for writing ABAC policies in XML and for the request and response format between enforcement and decision points. Version 3.0 was approved in 2013. Newer engines such as Open Policy Agent and Cedar use simpler languages but follow the same model.
8. Does AWS support ABAC?
Yes. AWS IAM supports ABAC through tags: policies compare tags on the principal, such as aws:PrincipalTag/project, with tags on the resource, such as aws:ResourceTag/project. One policy can then cover every project. You must also restrict who can change those tags, or users could grant themselves access.
9. What are the disadvantages of ABAC?
ABAC depends on accurate, fresh attributes, so bad attribute data leads to wrong decisions. Policies take more skill to design and test, "who can access this?" is harder to answer for audits, and the decision point and attribute sources add latency and availability concerns. Good tooling and logging reduce these costs.
10. How is ABAC used for API security?
For API security, ABAC checks attributes such as the consumer's tenant, plan and token scopes against the API's or object's attributes on every call. Gateways enforce API-level rules, and services enforce object-level rules such as "the order's tenant must match the caller's tenant", which prevents Broken Object Level Authorization (OWASP API1).
Conclusion
Attribute-based access control replaces "who are you?" with "is everything about this request allowed?" That shift lets one rule cover every tenant, plan and region, and lets access respond to context such as network, time and data class.
It only works if the attributes are right. Protect who can set them, trust signed and system-of-record sources over anything the client sends, let deny win, and log every decision. Start with one sensitive API and one tenant rule, prove it in log-only mode, then grow from there.
How safely do you grant API access to partners and AI agents? Get your free readiness score: Check Your API Access Readiness
Prefer a walkthrough? Book a Demo
One email a fortnight. Worth opening.
A short digest of what we're writing, what we're learning from customers, and the handful of links you'd actually want from us. No tracking pixels.













.avif)
