API Security
.
12
Mins Read

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.

Dhayalan Subramanian
Associate Director - Product Growth at DigitalAPI
In this blog
Share blog
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.

attribute based access control infographic showing subject, resource, action and environment attributes evaluated by a policy to allow or deny an API request

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.

Definition

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:read scope.
  • 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 typeDescribesExamplesTypical source
SubjectWho or what is callingTenant, plan, department, clearance, app type, scopesIdentity provider, token claims, HR or CRM
Resource (object)What is being accessedOwner, tenant, data class, region, sensitivity, API groupThe resource record, API catalog, data catalog
ActionWhat the caller wants to doRead, write, delete, export, approveThe request method and route
Environment (context)The conditions of the requestTime, source IP, device trust, environment, risk scoreThe 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.

ABAC request flow diagram where the API gateway acts as policy enforcement point, sends the request to the policy decision point, which pulls attributes from the policy information point and returns allow or deny

Here is how a single ABAC access control decision happens:

  1. 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.
  2. 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).
  3. 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.
  4. 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.
  5. The PDP returns allow or deny. It can also return obligations, such as "log this access" or "mask the email field".
  6. 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 forbid always beats a permit.
  • 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:

Cedar policy
// 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)

RequestAttributes that matterDecisionWhy
ACME's ERP app reads ACME order 4711Same tenant, has orders:readAllowRule 1 matches
Globex's app reads ACME order 4711Different tenantDenyNo rule permits it: the BOLA attempt fails
ACME's mobile app reads order 4711Same tenant, no scopeDenyScope missing
ACME's BI app exports ordersSame tenant, standard planDenyExport needs the enterprise plan
ACME's ERP app exports ordersSame tenant, enterprise planAllowRule 2 matches
ACME's ERP app reads a PII order from an unknown networkNot allowlistedDenyRule 3 forbid wins over rule 1
ACME's ERP app reads a PII order from the office networkAllowlistedAllowRule 1 matches, no forbid applies

Swipe sideways to see all columns →

attribute based access control example test results showing seven API requests allowed or denied by tenant, scope, plan and network attributes

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:

Cedar schema
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:

AWS IAM policy (JSON)
{
  "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 engineStyleWhere it fitsNotes
XACML (OASIS)XML policies, full PEP/PDP/PIP/PAP modelLarge enterprises, government, legacy IAM suitesThe original ABAC standard; verbose
Rego (Open Policy Agent)Declarative rules over JSON inputKubernetes, microservices, API gatewaysCNCF graduated project; general-purpose
Cedar (AWS, open source)Permit/forbid policies with a schemaApplication and API authorizationBuilt-in validation; forbid overrides permit
AWS IAM conditionsJSON conditions on tags and request keysAWS resourcesABAC through aws:PrincipalTag and aws:ResourceTag
Azure ABACConditions on role assignmentsAzure Storage and other Azure resourcesAdds 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.

ABAC attribute trust map showing signed token claims and system-of-record attributes as trusted, and client-supplied headers and query parameters as untrusted

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: acme or ?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

 RBACABAC
Decides byRole membershipSubject, resource, action and environment attributes
ExamplePartners can read ordersPartners can read orders of their own tenant, from allowlisted networks
GranularityPer rolePer request and per object
AuditEasy: list role membersHarder: 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

AdvantagesDisadvantages
Fine-grained: decisions per request and per object, not per roleAttribute quality is critical: wrong or stale attributes give wrong answers
Context-aware: time, network, device and risk can change the answerHarder to audit: "who can access X?" depends on attribute values
Fewer policies: one rule covers every tenant, project or regionPolicy design takes skill: rules can interact in surprising ways
No role explosion: new customers and plans are data changesMore moving parts: PDP, PIPs and caches must be fast and available
Supports least privilege: narrow access without hundreds of rolesLatency: 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

CheckAttributes usedWhere to enforce
Can this consumer call this API at all?Plan, partner tier, API group, environmentAPI gateway
Is this action allowed for this consumer?Token scopes, method and routeAPI gateway
Is this request allowed right now?Source IP, time, rate, risk scoreAPI gateway
Does this consumer own this object?Consumer tenant, object tenant or ownerService (or gateway with a lookup)
Can this field be returned?Data class, consumer clearance or contractService, 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:

  1. Pick one decision to fix first. Tenant isolation on your most sensitive API is usually the best start.
  2. List the attributes that decision needs and name the system of record for each one.
  3. Get attributes into the request path. Put stable ones in token claims; fetch changing ones from a PIP with a short cache.
  4. Lock down who can change attributes. Tags, catalog labels and plan fields need their own access control.
  5. Write policies in a policy language, not in application if statements, and validate them against a schema.
  6. Default deny and fail closed. No matching rule, or a policy error, means 403.
  7. Test with recorded requests. Keep a table of known requests and expected decisions, and run it in CI.
  8. Run new rules in log-only mode first, compare with current behaviour, then enforce.
  9. Log every decision with the policy ID and key attributes, so you can answer auditors.
  10. 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
About the author
Dhayalan Subramanian

Dhayalan Subramanian is Associate Director, Product Growth at DigitalAPI, where he leads go-to-market and product growth for the company’s multi-gateway API management platform. His work focuses on helping large enterprises and mid-market cloud companies consolidate APIs across AWS, Azure, Apigee, Kong, MuleSoft, and other gateways into a single control plane for governance, discovery, monetization, and agent consumption.

‍

Dhayalan brings 14+ years of experience across product strategy, enterprise architecture, and engineering leadership. Earlier in his career, he held senior roles at Encora (as Associate Architect and Technical Manager), Mindtree (Technology Lead), Tech Mahindra (Technical Lead), and Primus Analytics, where he designed integration frameworks and delivered enterprise-grade digital platforms for global customers.

‍

At DigitalAPI, he works directly with platform, integration, and developer experience leaders at Fortune 500 organizations to operationalize unified API catalogs, developer portals, and MCP-ready APIs. He writes regularly on API developer experience, API governance, and AI agent architectures.

Become AI-ready
Make every API agent-callable.
An 8-week pilot. We connect to your gateways, ship MCP-callable APIs, and onboard your first agent.
0 rip-and-replace
Same auth, same audit
Live in production in 8 weeks
Get started

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.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.