| Internet-Draft | Rego Policy in OAuth | June 2026 |
| Liu, et al. | Expires 11 December 2026 | [Page] |
AI agents exhibit dynamic, unpredictable behavior that cannot be fully described by traditional OAuth 2.0 scopes. This specification defines a behavioral authorization framework that enables clients, particularly AI agents, to propose Rego policy-based behavioral constraint contracts in OAuth 2.0 authorization flows using Rich Authorization Requests (RAR). It defines the rego_policy authorization data type for carrying behavioral constraint contracts in authorization_details, shifting the authorization model from static permission sets to runtime behavioral verification. It also defines a reverse-guided authorization mechanism allowing resource servers to return structured policy constraints in error responses, enabling agents to dynamically adapt their behavior and construct appropriate authorization requests.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 11 December 2026.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
AI agents differ fundamentally from traditional OAuth clients in that their behavior space is dynamic and often unpredictable at authorization time. When a human delegates a task such as "help me find and buy a laptop" to an AI agent, the specific sequence of operations (product comparison, price checking, coupon search, cart management, payment, shipping selection) emerges at runtime based on available products, pricing, user preferences, and agent reasoning. The agent's behavior cannot be fully enumerated in advance, which creates a tension between two competing requirements: granting the agent sufficient behavioral freedom to accomplish its task, and constraining the agent to the principle of least privilege.¶
Traditional OAuth 2.0 authorization relies on scopes, pre-defined static permission sets, to express what a client is allowed to do. This model assumes that the client's behavior space is known and enumerable at design time. For AI agents, this assumption does not hold: an overly broad scope grants unchecked power (violating least privilege), while an overly narrow scope causes frequent authorization failures that interrupt the agent's task execution. Existing policy engine deployments (e.g., Open Policy Agent (OPA) [OPA] sidecar patterns) address policy evaluation within a single administrative domain where policies are centrally managed, but do not solve the cross-organizational authorization problem where an agent must carry its behavioral constraints across multiple resource servers.¶
This specification builds on OAuth 2.0 [RFC6749] and Rich Authorization Requests (RAR) [RFC9396] by introducing a behavioral authorization framework: instead of requesting a fixed set of permissions, the client (agent) proposes a Rego [Rego] policy that serves as a behavioral constraint contract. The Authorization Server validates and approves this contract, and the Resource Server evaluates each of the agent's runtime behaviors against it. This shifts the authorization model from "what resources can the client access" to "within what behavioral boundaries can the client operate," enabling the agent to act freely within approved constraints while every individual behavior is verified at execution time.¶
The Rego policy also serves as a formal expression of human intent: when a human delegates a task to an agent, the policy encodes the boundaries of that delegation in a machine-verifiable form. The agent retains behavioral autonomy: it decides what to do and when, but every action is constrained by the policy approved by the Authorization Server. This enables a balance between agent autonomy and human oversight that is not achievable with static scope-based authorization.¶
This specification enables:¶
The rego_policy authorization data type can be used in
conjunction with the delegation_chain claim
([I-D.liu-oauth-chain-delegation]). When a
delegation hop carries a structured policy, the Rego behavioral
constraint contract defines the fine-grained authorization
constraints that were approved at that hop, complementing the
delegation lineage and attestation provided by
delegation_chain.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals.¶
This specification defines the rego_policy
authorization data type for use with Rich Authorization Requests (RAR)
[RFC9396]. The behavioral constraint contract is carried within the
authorization_details parameter as the primary mechanism.¶
Key aspects of the RAR integration:¶
rego_policy type is defined for use with the
authorization_details parameter per RFC 9396.
It contains the behavioral constraint contract (Rego
policy), entry point, and optional context.¶
authorization_details as the primary mechanism for
carrying the behavioral constraint contract. The
policy_ref claim MAY be included as a lightweight
alternative (see Section 3.2).¶
Implementations SHOULD ensure consistency between
authorization_details requirements and Rego policy evaluations.
The Authorization Server MAY use RAR types to determine applicable
policy templates or validation rules.¶
Resource Servers MAY advertise supported authorization details
types via the authorization_details_types_supported
attribute in Protected Resource Metadata
([RFC9728]), enabling clients to discover which
authorization details types are accepted before constructing
rego_policy authorization requests. This discovery
mechanism is particularly valuable in multi-tenant or federated
environments where different resource servers may require
different policy structures.¶
authorization_details parameter.¶
authorization_details parameter. The policy defines
the behavioral boundaries within which the client (agent)
is permitted to operate, evaluated by the Resource Server
against each runtime behavior.¶
policy_ref claim defined in this specification.¶
+--------+ +--------+ +--------+ +--------+
| Client | | AS | | RS | |Policy |
| | | | | | |Engine |
+--------+ +--------+ +--------+ +--------+
| | | |
| (1) AuthZ Req | | |
| with | | |
| behavioral | | |
| constraint | | |
| contract | | |
| (type=rego_ | | |
| policy) | | |
|--------------->| | |
| | | |
| | (2) Validate | |
| | policy syntax | |
| | | |
| | (3) Policy | |
| | approval | |
| | | |
| | | |
| (4) Access | | |
| Token with | | |
| behavioral | | |
| constraint | | |
| contract | | |
|<---------------| | |
| | | |
| (5) Agent | | |
| Behavior | | |
| with token | | |
|-------------------------------->| |
| | | |
| | | (6) Extract |
| | | behavioral |
| | | constraint |
| | | contract |
| | | |
| | | (7) Verify |
| | | behavior |
| | | against policy |
| | |--------------->|
| | | |
| | | (8) Allow/Deny |
| | |<---------------|
| | | |
| | | (9) Enforce |
| | | decision |
| | | |
| (10) Response | | |
|<--------------------------------| |
authorization_details
containing a rego_policy object, a proposed
behavioral constraint contract, with policy
and optional context fields. This leverages
RAR (RFC 9396) for structured authorization requests.¶
authorization_details array per RFC 9396
Section 7.1, binding the approved behavioral constraint
contract to the token.
The AS MAY include additional metadata in the
authorization_details object (e.g., server-assigned
identifiers or normalized policy content) but MUST NOT
alter the semantic meaning of the policy without client
consent.¶
authorization_details
in the access token.¶
Traditional OAuth error responses indicate authorization failure without providing guidance on how to obtain valid authorization. In behavioral authorization, this is particularly important: when an agent encounters behavioral drift (its next planned behavior falls outside the approved constraint contract), the agent needs structured guidance to recover autonomously. Resource servers can provide this guidance through structured error responses that enable agents to construct appropriate authorization requests with updated behavioral constraints.¶
When an agent's request lacks sufficient authorization, the resource
server returns an HTTP 403 Forbidden response with a
WWW-Authenticate header containing the
insufficient_authorization error code and a
rego_profile parameter. This parameter provides machine-readable
guidance on the required authorization conditions.¶
Per RFC 6750 [RFC6750] Section 3 and
RFC 6749 [RFC6749] Section 5.2, the error
response includes both the WWW-Authenticate header
with the insufficient_authorization error code and a
JSON error body. The rego_profile parameter in the
WWW-Authenticate header provides machine-readable
guidance on the required authorization conditions.¶
The rego_profile parameter value is a base64url-encoded
JSON object. Implementations SHOULD use base64url encoding
without padding (no trailing = characters) per
RFC 4648 [RFC4648] Section 5 to avoid
quoting issues in the WWW-Authenticate header.
The decoded object has the following structure:¶
{
"profile_uri": "https://resource.example/policies/purchase",
"required_scope": ["purchase.create"],
"required_claims": ["agent_id", "user_id"],
"constraints": {
"max_amount": {
"type": "number",
"description": "Maximum transaction amount in USD",
"required": true
},
"trigger_source": {
"type": "string",
"enum": ["user_initiated", "scheduled"],
"description": "Source of the operation trigger"
}
},
"confirmation_required": true,
"auth_server": "https://as.example.com"
}
RFC 6750 [RFC6750] defines the
insufficient_scope error for cases where the access
token lacks the scopes required by the resource server.
The insufficient_authorization error defined in this
specification addresses a broader condition: the token may
include adequate scopes but lack the policy-based authorization
structure (e.g., Rego constraints or user
confirmation) required by the resource server.¶
Resource servers SHOULD use insufficient_scope when
the deficiency is purely scope-based and
insufficient_authorization when the deficiency involves
policy constraints that cannot be expressed as additional scopes.¶
The rego_profile object contains the following fields:¶
agent_id, user_id) that MUST be present
in the access token issued by the AS.¶
type (data type),
description (human-readable explanation),
enum (allowed values), and required
(boolean, whether the constraint must be provided).¶
interaction_required error with JWT Grant Interaction
Response
[I-D.parecki-oauth-jwt-grant-interaction-response],
or the prompt parameter in the authorization code flow).¶
Upon receiving a reverse-guided authorization response, the AI agent SHOULD:¶
rego_profile to understand authorization requirements.¶
auth_server is trusted before
proceeding.¶
rego_profile, and any additional
parameters required by the resource server.¶
confirmation_required is true, initiate user consent flow.¶
auth_server's metadata (RFC 8414) and
submit the authorization request.¶
This adaptive approach enables agents to "learn" authorization requirements dynamically, reducing the need for pre-programmed knowledge of each resource server's policies.¶
During multi-step task execution, an agent may encounter
behavioral drift: situations where the next
behavior in its plan falls outside the approved policy
constraints. When this occurs, the agent has three options:
(1) request a new authorization with an updated policy that
accommodates the new behavior (using the reverse-guided
authorization mechanism described above); (2) degrade its
behavior to stay within the approved constraints (e.g.,
selecting an alternative, less privileged action); or
(3) request human confirmation to approve an expanded
behavioral boundary. The choice among these options depends
on the agent's task context and the
confirmation_required signal from the resource
server. Implementations SHOULD prefer degradation over
re-authorization for minor boundary violations to avoid
excessive authorization round-trips in long-running agent
workflows.¶
Implementations of reverse-guided authorization MUST consider the following security aspects:¶
auth_server specified in the rego_profile is trusted
before submitting authorization requests. Agents MUST
use only the token endpoint discovered from the
auth_server's Authorization Server Metadata
([RFC8414]). Blindly following
redirects could lead to credential theft.¶
Upon receiving an authorization_details request containing the
rego_policy type, the AS MUST perform the following
validation steps:¶
entry_point field (defaulting
to allow if not specified).¶
http.send, excessive resource consumption).¶
actions, locations) do not exceed the
client's registered permissions. This check provides an
approximate upper-bound enforcement based on declarative
fields rather than full Rego AST analysis. The AS MAY
perform lightweight static analysis of the Rego
policy (e.g., extracting referenced input.action
values) to detect obvious inconsistencies between the
policy content and the declared RAR fields.¶
When the AS issues a policy_ref claim instead of
embedding the full policy in authorization_details,
the AS MUST register the policy:¶
When the AS embeds the validated policy directly in the
enriched authorization_details (the primary path),
explicit registration is not required; the policy travels
with the token.¶
Policy registration in this specification is dynamic and on-demand. The Authorization Server does not need to maintain a pre-configured catalog of policies. When an agent proposes a behavioral constraint contract, the AS evaluates it against pre-established approval principles (see Section 6) and registers it only if approved. This eliminates the operational burden of pre-deploying policies for every anticipated agent behavior, which is impractical given the dynamic and unpredictable nature of AI agent workflows.¶
Deployments MAY also pre-register policies for well-known agent workflows (e.g., automated reconciliation, scheduled reporting) where the behavioral boundaries are stable and known in advance. In such cases, the agent can reference the pre-registered policy by identifier rather than submitting the full policy content in each authorization request. Both modes are supported: dynamic registration is the default for exploratory agent tasks, while pre-registration is an optimization for predictable workflows.¶
If policy validation fails, the AS MUST return an error:¶
{
"error": "invalid_request",
"error_description": "Invalid Rego policy: syntax error at line 5"
}
The following error conditions MUST be handled:¶
content nor uri is present in
the policy object, the AS MUST return
invalid_request with a description indicating the
missing policy source.¶
uri is present and the AS fails to fetch
the policy content (e.g., network timeout, HTTP error, or
invalid response), the AS MUST return
invalid_request with a description indicating the
fetch failure.¶
uri is present and the AS policy prohibits
external URI fetching, the AS MUST return
invalid_request with a description suggesting the
client use inline content instead.¶
The Authorization Server's approval of a behavioral constraint contract is not limited to syntactic validation. The AS determines whether the proposed behavioral boundaries are appropriate for the specific client and resource owner based on the following factors:¶
interaction_uri mechanism in JWT Grant Interaction
Response).¶
For example, the AS MAY maintain a per-client allowlist of
approved behavioral patterns (e.g., permitted actions, maximum
transaction limits, allowed resource classes). When a client
proposes a new behavioral constraint contract, the AS verifies
that the declared RAR common fields
(actions, locations) fall within the client's
pre-approved boundaries. If the proposed contract exceeds these
boundaries, the AS SHOULD return invalid_scope when
the behavioral boundaries exceed the client's registered
permissions, or invalid_request for other policy
violations. Alternatively, the AS MAY escalate to the resource
owner for explicit consent before issuing the token.¶
This layered approval model ensures that the behavioral constraint contract carried in the access token is trusted not only for its syntactic correctness but also for its alignment with the authorization policies governing the client-resource owner relationship. The Resource Server can rely on this trust when evaluating each agent behavior against the approved contract at runtime.¶
The RS obtains the Rego policy from the access token. The
primary mechanism is to extract the policy from the enriched
authorization_details array included in the token
per RFC 9396 Section 7.1.¶
The binding between the policy and the access token depends
on the token type. For JWT access tokens, the policy content
or policy_ref claim is integrity-protected by the
token signature. For opaque tokens, the binding is established
through token introspection [RFC7662] or a
shared back-channel between the AS and RS.¶
When the token uses the policy_ref claim instead
of inline policy content, the RS retrieves the policy using
one of the following methods:¶
After extracting the Rego policy from the token, the RS MUST load the policy into a Rego-compatible policy engine before querying it. Common loading mechanisms include:¶
PUT /v1/policies/{id} to register
the policy, then query the Data API;¶
Once loaded, the RS queries the policy engine with the request context as input:¶
POST /v1/data/agent/allow HTTP/1.1
Host: opa.example.com
Content-Type: application/json
{
"input": {
"user": {
"id": "user_12345",
"tier": "premium"
},
"action": "search_products",
"resource": {
"type": "product",
"id": "product_001"
}
}
}
{
"result": true
}
Based on the policy engine's response:¶
result is true: Allow the agent's behavior;¶
result is false: Deny the behavior with
403 Forbidden;¶
result is undefined (OPA returns an empty
object with no result field): Deny with
403 Forbidden. Note that policies following the
RECOMMENDED default allow = false pattern
(see Section 3.1.3) will always produce a defined
boolean result, so undefined only occurs when the
default declaration is omitted;¶
The rego_policy authorization data type defined in this
specification can be used with any OAuth 2.0 authorization flow
that supports Rich Authorization Requests (RAR)
[RFC9396]. This section illustrates usage with
flows that are particularly relevant to AI agent scenarios.¶
The JWT Authorization Grant Interaction Response
[I-D.parecki-oauth-jwt-grant-interaction-response]
is the RECOMMENDED flow for AI agent scenarios. In this flow,
an agent presents a JWT assertion to the token endpoint. If
user interaction (e.g., consent) is required before the token
can be issued, the AS returns an interaction_required
error with an interaction_uri where the user can
complete the interaction. The agent then polls for the token.¶
When combined with Rego Policy, the agent includes
authorization_details containing the
rego_policy type in the JWT grant request. The AS
validates the behavioral constraint contract, performs
behavioral boundary checks, and determines whether user
consent is needed before issuing the token.¶
POST /token HTTP/1.1 Host: as.example.com Content-Type: application/x-www-form-urlencoded grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &assertion=eyJhbGciOiJSUzI1NiJ9... &authorization_details=%5B%7B%22type%22%3A%22rego_policy%22%2C %22policy%22%3A%7B%22type%22%3A%22rego%22%2C %22content%22%3A%22package%20agent%5Cn... %22entry_point%22%3A%22allow%22%7D%2C %22actions%22%3A%5B%22search_products%22%2C%22add_to_cart%22%5D%7D%5D
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"error": "interaction_required",
"interaction_uri": "https://as.example.com/interact/abc123",
"interval": 5,
"expires_in": 600
}
After the user completes the interaction, the agent retries
the same JWT grant request. The AS then issues the access
token with the enriched authorization_details
containing the validated Rego policy.¶
In machine-to-machine scenarios using client credentials, the behavioral constraint contract can be included in the token request:¶
POST /token HTTP/1.1 Host: as.example.com Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=spiffe%3A%2F%2Fagent.example%2Fagent &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=eyJhbGciOiJSUzI1NiIs... &authorization_details=%5B%7B%22type%22%3A%22rego_policy%22%2C %22policy%22%3A%7B%22type%22%3A%22rego%22%2C%22content%22%3A%22...%22%2C %22entry_point%22%3A%22allow%22%7D%7D%5D
When exchanging tokens [RFC8693], a new behavioral constraint contract can be provided to refine or restrict the approved behavioral boundaries:¶
POST /token HTTP/1.1 Host: as.example.com Content-Type: application/x-www-form-urlencoded grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange &subject_token=eyJhbGciOiJSUzI1NiJ9... &subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token &authorization_details=%5B%7B%22type%22%3A%22rego_policy%22%2C %22policy%22%3A%7B%22type%22%3A%22rego%22%2C%22content%22%3A%22...%22%2C %22entry_point%22%3A%22allow%22%7D%7D%5D
The resulting access token MUST include the new behavioral
constraint contract. The AS SHOULD verify that the new policy does
not appear to grant permissions exceeding those of the
original token. The AS MAY use the RAR common fields
(actions, locations) as an approximation,
since comparing two Rego policies for semantic subset
containment is undecidable in the general case.¶
Token Exchange is a common trigger for behavioral
drift: when an agent's next planned behavior falls
outside the approved policy constraints, the Resource Server
can return an insufficient_authorization error with
a rego_profile (as defined in
Section 5), guiding the agent toward
constructing an appropriate Token Exchange request with an
updated behavioral constraint contract. This enables
multi-hop delegation scenarios where each hop progressively
refines the behavioral boundaries to match the delegatee's
specific task requirements.¶
Rego policies submitted by clients are evaluable policy
definitions. Although Rego is a declarative language, it
supports recursive rules, regular expressions, and built-in
functions that may lead to non-terminating or resource-intensive
evaluations. Maliciously crafted policies can exploit
catastrophic backtracking in regular expressions (e.g.,
regex.match("^(a+)+$", "aaa...!")) or trigger
combinatorial explosion in set operations, leading to
denial of service at the Resource Server's policy engine.
The AS and RS MUST:¶
In a behavioral authorization framework, the client (agent)
proposes the behavioral constraint policy. A malicious agent
could craft a policy that appears restrictive in its Rego
structure but contains subtle permissiveness. For example,
using negation-by-failure to create unintended allow paths,
or embedding wildcard conditions that match broader behavior
sets than the RAR common fields suggest. The AS SHOULD
perform lightweight static analysis (e.g., extracting
referenced input.action values, detecting
unbounded wildcards) to detect obvious inconsistencies.
The Resource Server, as the policy execution point, bears
final responsibility for ensuring each agent behavior is
verified against the approved constraints.¶
The policy_ref in access tokens MUST reference policies stored securely by the AS. Resource Servers MUST fetch policies only from trusted sources.¶
When retrieving policy content from the policy_ref.endpoint
URL, the Resource Server SHOULD authenticate to the AS policy
endpoint using mutually authenticated TLS (mTLS) or a
pre-shared service token. Anonymous retrieval of policy
content SHOULD NOT be performed, as it allows any party that
discovers the endpoint URL to obtain the policy content.
The hash field in policy_ref provides
integrity verification of the retrieved content but does
not authenticate the retrieval channel itself.¶
Resource Servers SHOULD invalidate cached policy content when the associated access token expires. If the AS revokes a registered policy before the token expires, the RS MUST treat subsequent policy evaluations as failed (deny-by-default). The AS MAY signal policy revocation via token introspection [RFC7662] (indicating the token is no longer active) or through a deployment-specific notification mechanism.¶
When the uri field within the policy object
is present, the AS fetches
policy content from a client-provided URI. This introduces
Server-Side Request Forgery (SSRF) risks. The AS MUST:¶
Rego policies embedded inline within authorization_details can significantly increase token request and access token size. Implementations MUST enforce limits on:¶
For policies exceeding these limits, clients SHOULD use
pre-registered policies referenced via policy_ref
rather than inline policy content.¶
The rego_profile parameter carried in the
WWW-Authenticate header (see Section 5)
is a base64url-encoded JSON object that can include
multiple constraint definitions, required claims, and scope
arrays. Implementations MUST enforce size limits on the
rego_profile value to avoid exceeding HTTP header
size limits imposed by intermediaries. A RECOMMENDED limit
is 2 KB for the base64url-encoded rego_profile value.
Resource servers that require larger profiles SHOULD consider
returning only a profile_uri reference and having
clients fetch the full profile separately.¶
In behavioral authorization, the policy defines what behaviors are permitted, but compliance requires evidence of what behaviors were actually performed. This is especially critical in AI agent scenarios where the agent operates autonomously and may execute long sequences of behaviors without direct human oversight.¶
Resource Servers SHOULD log each policy evaluation event
including: the policy identifier (policy_ref.id),
a hash or summary of the evaluated input, the allow/deny
result, and the evaluation timestamp. These audit logs
enable post-incident analysis of agent behavior, detection
of behavioral drift patterns, and compliance reporting.
Audit logs SHOULD be protected against tampering and
retained according to the deployment's data retention
policy. Authorization Servers MAY also log behavioral constraint proposals
received from clients to detect repeated boundary-testing
behavior by malicious agents.¶
Implementations of this specification MUST consider the following privacy aspects per BCP 188 [RFC6973]:¶
authorization_details may reference user attributes
(e.g., input.user.tier, input.user.role).
When policies are carried in JWT access tokens, these attribute
references are visible to any party that can decode the token.
Implementations SHOULD avoid embedding personally identifiable
information (PII) directly in policy content and instead
reference abstract attribute names that the Resource Server
resolves at evaluation time.¶
rego_profile returned in error responses reveals
authorization policy constraints to the requesting client.
While this disclosure is necessary for the reverse-guided
authorization flow, resource servers SHOULD limit the
information to what is strictly needed for the client to
construct a valid authorization request, and MUST NOT include
internal implementation details, database schemas, or
infrastructure information.¶
policy_ref.endpoint field and the
auth_server field in rego_profile reveal
internal URLs of the Authorization Server. Deployments SHOULD
use well-known or abstract endpoint identifiers rather than
exposing internal service URLs.¶
rego_policy behavioral constraint proposals submitted by a client may
reveal the client's intent, capabilities, or decision-making
patterns. Authorization Servers SHOULD treat behavioral constraint proposals
with the same confidentiality as other authorization request
parameters and MUST NOT use them for purposes beyond
authorization decision-making without explicit consent.¶
This specification defines the following authorization data type
for use with the authorization_details parameter
defined in RFC 9396:¶
This specification registers the following claim in the "JWT Access Token JWT Claims" registry established by [RFC9068]:¶
This specification registers the following error code in the "OAuth 2.0 Bearer Token Error Values" registry established by [RFC6750]:¶
WWW-Authenticate header per [RFC6750].¶
insufficient_scope error defined in
[RFC6750] addresses scope insufficiency.
insufficient_authorization (this specification) addresses the case where the
resource server returns structured policy constraints
(rego_profile) for clients capable of constructing
policy-based authorization requests.¶
This specification defines a new parameter for use in the
WWW-Authenticate header field with the Bearer
authentication scheme, as defined in [RFC6750].¶
WWW-Authenticate response header field, used in
resource server error responses per [RFC6750]
Section 3.¶
RFC 6750 does not establish an IANA sub-registry for Bearer
authentication scheme parameters. This section serves as the
specification reference for the rego_profile parameter.¶
package agent
default allow = false
# Allow transactions up to $50
allow if {
input.action == "purchase"
input.amount <= 50.0
}
# Allow cart modifications without amount limit
allow if {
input.action == "add_to_cart"
}
package agent
default allow = false
# Allow during business hours
allow if {
input.action == "submit_order"
hour := time.clock(time.now_ns())[0]
hour >= 9
hour < 18
}
package agent
default allow = false
# Premium users can access all features
allow if {
input.user.tier == "premium"
}
# Standard users limited to basic actions
allow if {
input.user.tier == "standard"
input.action == "read"
}
The authors would like to thank Brian Campbell for his valuable feedback and insightful discussions during the development of this specification. His contributions helped shape key design decisions.¶