Policy templates

Reference for the built-in policy templates in the Agent Gateway policy editor: what each template decides, its settings and defaults, the policy input it reads, and the policy slots where it decides.

Policy templates are ready-made Rego policies and rules that the policy editor offers when you create or change a policy definition.

Overview

From version 1.0.10, the policy editor ships with 20 built-in templates. A new policy starts from one of them under Start from, or as a custom policy, and Add rules from a template adds a template’s rules to a policy you already have. Each template has a short description, its settings, the Rego it writes, examples under How it decides, and a link to the docs section it follows. For the steps, see Apply OPA policies to your gateway and surfaces.

A template is one of two kinds:

  • Whole policy: decides on its own, so it is offered only under Start from on a new policy. Adding its rules to another policy would allow requests that policy denies, because allow rules combine with OR.
  • Adds rules: a set of rules you can add to any policy of its Type. The Add rules from a template panel lists only these, marked Adds rules, with the template’s own default decision, Default DENY or Default ALLOW.

Templates are part of the dashboard. A policy keeps only the Rego a template writes, so editing a template’s Rego in your policy changes nothing else. A template written for one Type reads input the other Type doesn’t get, so Define Gateway Policy lists only the 6 templates for gateway policies, and Define Agent Surface Policy the 20 for surface policies. On a surface policy, a template offered for surfaces only is marked Agent surface only.

A setting that depends on your deployment, such as an issuer, a DID or a path, starts empty with a sample value as its placeholder. Use this template and Add to policy stay disabled until you fill it in, and the Rego preview uses the sample value meanwhile.

Templates at a glance

TemplateKindOffered forCategory
Deny by defaultWhole policyGateway and Agent SurfaceBaseline
Monitor-only baselineWhole policyGateway and Agent SurfaceBaseline
Require authenticated callerAdds rulesAgent SurfaceAuthentication
Allow by JWT claim or roleAdds rulesAgent SurfaceAuthentication
Allow by JWT issuer and audienceAdds rulesAgent SurfaceAuthentication
Require Trust Registry recognitionAdds rulesAgent SurfaceTrust checks
Require verified credential subjectAdds rulesAgent SurfaceTrust checks
All trust checks passAdds rulesAgent SurfaceTrust checks
At least N trust checks passAdds rulesAgent SurfaceTrust checks
Allowlist outbound destinationsWhole policyAgent SurfaceRouting & paths
Allow listed HTTP methodsAdds rulesGateway and Agent SurfaceRouting & paths
Allow listed pathsAdds rulesGateway and Agent SurfaceRouting & paths
Allow listed surfacesAdds rulesGateway and Agent SurfaceRouting & paths
Restrict MCP tools by roleWhole policyAgent SurfaceAllow / deny lists
Allow listed subjectsAdds rulesAgent SurfaceAllow / deny lists
Business-hours access windowWhole policyGateway and Agent SurfaceTime
Tool policy: allow authenticated callersWhole policyAgent SurfaceMCP tool policies
Tool policy: allow by JWT claimWhole policyAgent SurfaceMCP tool policies
Tool policy: admin role with a deny reasonWhole policyAgent SurfaceMCP tool policies
Tool policy: allow every callerWhole policyAgent SurfaceMCP tool policies

Where a template decides

A surface has several policy slots, set by the edge you drop a Policy element on. See Policy element. A template that reads the caller decides only in the slots where the policy input describes the caller. Elsewhere it reads another party, or nothing, and gives the result in this table.

TemplateAccess Point and Target request policiesTransit Point policyTarget or Transit Point response policyRequest policy of a fabric:// Target
Require authenticated caller, Allow by JWT claim or role, Allow by JWT issuer and audience, Allow listed subjectsDecides on the callerReads the client the Transit Point authenticated, not the callerDenies every responseDecides on the caller
Restrict MCP tools by roleDecides on the callerReads the client the Transit Point authenticated, not the callerDenies every responseDecides on the caller for a 2026-07-28 MCP request, and denies earlier MCP requests
Require Trust Registry recognitionDecides on the callerReads the destination, not the callerDenies every responseDenies every request
Require verified credential subjectDecides on the callerDenies every requestDenies every responseDenies every request
Allowlist outbound destinationsAllows every requestDecides on the destinationAllows every response on the Target, and denies every response on a Transit PointAllows every request
Allow listed HTTP methods, Allow listed paths, Allow listed surfacesDecidesDecidesDenies every responseDecides
All trust checks pass, At least N trust checks passDecides on the Target’s checksDecides on that Transit Point’s checksDenies every responseDecides on the Target’s checks

Business-hours access window reads only the clock and decides in every slot. Allow listed HTTP methods, Allow listed paths and Allow listed surfaces read the HTTP method, the path or the surface, which every request policy gets. A response policy doesn’t get them, so these templates deny every response there. See Response policy input.

All trust checks pass and At least N trust checks pass read only target-leg results, from the Trust Checks on the Managed Agent’s Target or on the Transit Point the request goes through. They don’t read Trust Checks on the Access Point, they deny a request on which no target-leg check ran, and they also deny every response in a response policy. The tool policy templates are for policies bound to MCP tools, not for a slot.

Baseline templates

Deny by default

Denies every request. Start here, then add or write the rules that allow what you need. A new policy starts as this template until you choose another.

ItemValue
KindWhole policy
Offered forGateway and Agent Surface
SettingsNone
ReadsNothing
NotesAssigned appliance-wide, it also decides public discovery reads such as /discovery and /.well-known/ucp.
Docs linkDefault allow vs default deny

Monitor-only baseline

Allows every request, so you can watch traffic before you write a stricter policy: through the Audit Log when policy decisions are audited, or through policy input capture.

ItemValue
KindWhole policy
Offered forGateway and Agent Surface
SettingsNone
ReadsNothing
NotesTo try a stricter policy without blocking requests, enforce it appliance-wide with the Monitor option on the Policies list instead.
Docs linkDefault allow vs default deny

Authentication templates

These templates read input.source_auth, the caller the surface’s Caller Context element authenticated. They decide on the Access Point and Target request policies. On a Transit Point, input.source_auth is the client the Transit Point authenticated, not the caller, and a Target response policy has no input.source_auth.

Require authenticated caller

Allows a request only when the caller authenticated with one of the surface’s Caller Context methods. Denies callers whose credential was missing or invalid, and requests on a surface without caller authentication.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsNone
Readsinput.source_auth.method
Docs linkApply OPA policies: steps

Allow by JWT claim or role

Allows a request when the caller authenticated with a JWT and the chosen claim holds one of the listed values. A claim that is a list matches when any of its values is listed. Denies every other caller.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsClaim: the JWT claim to check, such as role, roles or groups. Default role.
Allowed values: required, separated by commas. Sample admin.
Readsinput.source_auth.claims
Docs linkUse JWT claims to control access to a surface

Allow by JWT issuer and audience

Allows a request only when the caller’s JWT was issued by one of the listed issuers and names one of the listed audiences. Denies every other caller.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsAllowed issuers: required, exact iss values separated by commas. Sample https://login.example.com.
Allowed audiences: required, exact aud values separated by commas. Sample https://gateway.example.com.
Readsinput.source_auth.claims.iss, input.source_auth.claims.aud
NotesA token without an aud claim is denied, as from an identity provider whose JWT Bearer method checks client_id or azp instead.
Docs linkinput.source_auth

Trust check templates

Require Trust Registry recognition

Allows a request only when the calling agent’s DID is the caller identity the gateway established and the trust registry recognised it. A DID the request only names, without proof, is not enough.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsNone
Readsinput.agent.did, input.agent.did_verified, input.agent.trust_verification
RequirementsA verified caller DID (input.agent.did_verified), and Enrich policy input with agent context turned on in the Policy element. Without it, input.agent has no trust_verification and every request is denied.
RestrictionsDecides on the Access Point and Target request policies. On a Transit Point input.agent describes the destination, not the caller, and a response policy has no input.agent. As the request policy of a fabric:// Target, input.agent describes this Access Point’s own card, so it denies every request there.
Docs linkRequire trusted agents

Require verified credential subject

Allows a request only when the gateway verified the caller’s DID, from an identity presentation or a bound source credential, and that DID is on the list. Denies unverified and unlisted callers.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsAllowed DIDs: required, caller DIDs separated by commas. Sample did:web:agent.example.com.
Readsinput.extension_identity.did, input.extension_identity.verified
RequirementsA verified caller DID (input.extension_identity.verified).
RestrictionsDecides on the Access Point and Target request policies. A Transit Point policy, a response policy and the request policy of a fabric:// Target have no input.extension_identity, so it denies every request there.
Docs linkinput.extension_identity

All trust checks pass

Allows a request only when at least one Trust Check ran on the target leg and every one passed. The target leg is the Managed Agent’s Target, or the Transit Point the request goes through. Denies when any check failed or none ran.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsNone
Readsinput.trust_check_results.target
NotesA check that queries several Authorities passes when any of them recognises the entity. Trust Checks on the Access Point are not read.
Docs linkinput.trust_check_results

At least N trust checks pass

Allows a request when the number of target-leg Trust Checks that passed reaches your threshold. Denies when fewer pass, or when no checks ran.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsMinimum passing checks: from 1 to 20. Default 2.
Readsinput.trust_check_results.target
NotesA check that queries several Authorities counts once, and passes when any of them recognises the entity. Trust Checks on the Access Point are not counted.
Docs linkinput.trust_check_results

Routing and path templates

Allowlist outbound destinations

Allows a request through a Transit Point only when the Transit Point’s configured endpoint (input.gateway.target_id) is one of the listed destinations, or a path under one.

ItemValue
KindWhole policy
Offered forAgent Surface
SettingsAllowed destinations: required, separated by commas. An endpoint URL such as https://api.example.com, or fabric://<gateway id> for a Fabric route. Sample https://api.example.com, fabric://partner-gateway.
Readsinput.transit, input.gateway.target_id
RestrictionsDecides only on Transit Point requests, where the gateway sets input.transit. Used as the surface’s Access Point or Target policy, it allows every request, including the request a fabric:// Target sends, whose direction is also outbound but whose target_id is the peer gateway’s DID.
NotesA Transit Point matches when its endpoint is a listed destination or a path under it, never a longer host name.
Docs linkinput.gateway

Allow listed HTTP methods

Allows a request only when its HTTP method is on the list, for example to keep a surface read-only.

ItemValue
KindAdds rules
Offered forGateway and Agent Surface
SettingsAllowed methods: upper case, separated by commas. Default GET.
Readsinput.http.method
NotesAssigned appliance-wide, it also decides public discovery reads such as /discovery and /.well-known/ucp.
Docs linkCommon policy patterns

Allow listed paths

Allows a request only when its path is one of the listed prefixes or a path under one. Only whole path segments match: /my-surface/public allows /my-surface/public/docs, not /my-surface/public-admin.

ItemValue
KindAdds rules
Offered forGateway and Agent Surface
SettingsAllowed path prefixes: required, whole path prefixes separated by commas. Sample /my-surface/public/.
Readsinput.http.path
RequirementsEach prefix starts with the surface’s Access Point route, because the path is the whole request path: /my-surface/public/ for a route /my-surface. On a Transit Point, the path starts with /outbound, the route and the Transit Point’s alias, or with the Transit Point’s own listen path.
NotesDenies a path that contains .., %2e, %25, a backslash or %5c. Assigned appliance-wide, it also decides public discovery reads such as /discovery and /.well-known/ucp.
Docs linkinput.http

Allow listed surfaces

Allows a request only when it is for one of the listed surfaces, matched by surface ID. A surface ID stays the same when the surface is renamed, and another surface can share a surface’s name. Useful for a policy enforced across every surface.

ItemValue
KindAdds rules
Offered forGateway and Agent Surface
SettingsSurface IDs: required, separated by commas. Each ID is shown in the read-only Surface ID field of the surface panel, and at the end of the surface page’s address (/surfaces/<id>).
Readsinput.channel.config_id
NotesAssigned appliance-wide, it also decides public discovery reads such as /discovery and /.well-known/ucp.
Docs linkCommon policy patterns

Allow and deny list templates

Restrict MCP tools by role

Lets callers with an admin role call any MCP tool, and other authenticated callers only the listed safe tools. Every authenticated caller can use other MCP methods, such as tools/list. A caller is authenticated when it passed one of the surface’s Caller Context methods, such as JWT Bearer or API Key.

ItemValue
KindWhole policy
Offered forAgent Surface
SettingsAdmin roles: required, values of the JWT role claim that may call any tool, separated by commas. A role claim that is a list matches when any of its values is listed. Sample admin.
Safe tools: required, MCP tools every authenticated caller may call, separated by commas. Sample search, summarise, translate.
Readsinput.source_auth.method, input.source_auth.claims.role, input.mcp.method, input.mcp.tool_name
RestrictionsDecides on the Access Point and Target request policies. Denies a request without input.mcp, such as a JSON-RPC message without an id, or an MCP request earlier than 2026-07-28 that a fabric:// Target sends on.
Docs linkRestrict tool access by role

Allow listed subjects

Allows a request only when the caller authenticated with a JWT and its subject is on the list. The subject is the value of the JWT verification strategy’s Caller identity claim, sub unless the strategy names another. Denies every other caller.

ItemValue
KindAdds rules
Offered forAgent Surface
SettingsAllowed subjects: required, values of the strategy’s caller identity claim, separated by commas. Sample user@example.com.
Readsinput.source_auth.subject
RestrictionsDecides on the Access Point and Target request policies, like the authentication templates.
Docs linkinput.source_auth

Time templates

Business-hours access window

Allows, or denies, requests made inside a daily time window on the listed days, in the chosen time zone. Requests outside the window get the opposite decision.

ItemValue
KindWhole policy
Offered forGateway and Agent Surface
SettingsInside the window: Allow requests lets requests through only inside the window, and Deny requests refuses requests inside it and lets every other request through. Default Allow requests.
Days: English day names, separated by commas. Leave empty for every day. Default Monday to Friday.
From: start of the window, as HH:MM. Default 09:00.
Until: end of the window, as HH:MM. Requests from this time on are outside it. It must differ from From. Default 17:00.
Time zone: an IANA time zone, such as Europe/Berlin or Asia/Singapore. Default UTC.
ReadsThe current time, in the chosen time zone
NotesAn Until earlier than From makes the window cross midnight, for example 22:00 to 06:00. Each part counts on its own date: with Monday to Friday, Monday 01:00 is inside the window and Saturday 01:00 is outside. A request whose time the policy can’t read in the time zone is denied in both modes. Rate limits are set on the surface’s Rate Limit panel, not in policy. See also Time-based decisions.
Docs linkPolicy input reference

This template has no How it decides examples, since its decision depends on the time of the request.

Tool policy templates

These four templates are for a policy bound to MCP tools, which decides each tools/call to the surface’s MCP Target. Each card is marked MCP tool policy. Bind the policy to tools on the Per-Tool Access Control list, as in Control MCP tool access with per-tool policies.

The first three read input.jwt, the claims of the bearer token in the request’s Authorization header, which the tool policy decodes without verifying. Use them only on a closed Access Point whose Caller Context methods are all JWT Bearer reading the Authorization header with the Bearer scheme, so the gateway verifies the token first.

Tool policy: allow authenticated callers

Allows a call when the request’s bearer token has a sub claim.

ItemValue
KindWhole policy
Offered forAgent Surface
SettingsNone
Readsinput.jwt.sub
RequirementsA closed Access Point whose Caller Context methods are all JWT Bearer reading Authorization with Bearer.

Tool policy: allow by JWT claim

Allows a call when a claim of the request’s bearer token, a single value or a list, has one of the listed values. Covers admin-only and subscription-based access.

ItemValue
KindWhole policy
Offered forAgent Surface
SettingsClaim: the token claim to read, such as role or subscription. Default role.
Allowed values: required, separated by commas. Sample admin.
Readsinput.jwt
RequirementsA closed Access Point whose Caller Context methods are all JWT Bearer reading Authorization with Bearer.

Tool policy: admin role with a deny reason

Allows callers whose bearer token has the allowed role, as a single value or in a list. It sets deny_reason when the token has no role or another one. The reason is written to the audit log only, not to the response.

ItemValue
KindWhole policy
Offered forAgent Surface
SettingsAllowed role: required, the role claim value that may call the tool. Sample admin.
Readsinput.jwt.role
RequirementsA closed Access Point whose Caller Context methods are all JWT Bearer reading Authorization with Bearer.

Tool policy: allow every caller

Allows every call, so only the tools listed on the binding decide what can be called.

ItemValue
KindWhole policy
Offered forAgent Surface
SettingsNone
ReadsNothing