Skip to main content
Version: 11.5.0

Policy Attribute Reference

A HYPR AgentPass™ policy condition can refer to any attribute on this page. The New policy wizard carries the same list in its Available attributes panel, on the Logic step. This page adds what the panel cannot say at length: when each attribute is present.

How to Read This Reference​

An attribute is either always present on the traffic described, or present only when the gateway resolved it. When an attribute is absent, a condition that tests it is not a match. The policy does nothing, and reports no error.

That is the safe direction. It also means a block written only on a sometimes-absent attribute lets through the traffic it never learned about. How Policies Are Evaluated explains this in full. On this page, the Presence column tells you which case you are in.

Types are CEL's: String, Int, Bool, List, and Map for a parsed JSON object. You reach a map's fields with dots, such as request.body.max_tokens. Test a field that might not be there with has() before comparing it.

Request​

These attributes are present on every request, in both phases.

AttributeTypePresenceDescription
request.methodStringAlwaysHTTP method, such as GET, POST, PUT or DELETE
request.pathStringAlwaysRequest path, such as /v1/messages
request.headersMapAlwaysHTTP request headers
request.bodyMapAlwaysThe parsed JSON body. An empty map when the body is not JSON.
request.body_rawStringAlwaysThe request body as unparsed text. An empty string when there is no body.
request.listenerStringAlwaysThe listener that received the request. Usually the connector's name, and agent-portal on Agent Portal traffic
request.routeStringAlwaysReserved. An empty string on current traffic, so do not build a rule on it
request.backendStringAlwaysThe backend the request will be forwarded to. Usually the connector's name
request.userStringWhen the gateway resolved the personSee The Signed-In Person
request.agentMapAlways; empty when unauthenticatedSee The Calling Agent
request.file_countIntAlways; 0 when noneSee Attached Files
request.filesListWhen the request carries filesSee Attached Files

The Calling Agent​

request.agent describes the agent identity the gateway authenticated for this request. It is an empty map when the caller is unauthenticated, so each of these fields is absent on anonymous traffic:

AttributeTypePresenceDescription
request.agent.nameStringWhen authenticatedThe agent's name
request.agent.ownerStringWhen authenticatedEmail of the agent's owner, its supervisor
request.agent.scopesList of StringWhen authenticatedThe agent's permission scopes
request.agent.typeStringWhen the agent holds an inference or tools scopeinference, tools or both, derived from the scopes. Absent for an agent with neither.

The Signed-In Person​

One attribute identifies the person a request acts for.

AttributeTypePresenceDescription
request.userStringWhen the gateway resolved the personEmail of the person this request acts for, as the gateway verified it at sign-in. That is someone chatting in the Agent Portal, or an agent session established against a verified identity. Never a value the caller claimed about itself.

The gateway resolves the person on MCP, REST API and Microsoft 365 Copilot connectors, and on an Agent Portal upload. On Anthropic, OpenAI, AWS Bedrock and custom connectors, request.user is absent.

request.user is absent when nobody signed in. A block written as !request.user.endsWith("@example.com") therefore lets every anonymous request through. Write it with a guard that is always present, as shown in Policy Examples. Requiring a sign-in in the first place is the connector's job, not the policy's.

The Person's Groups​

AttributeTypePresenceDescription
request.user_groupsList of StringOn a request that runs a modelThe names of the user groups the request's person belongs to. An empty list when they are in none

The person is the one whose spend the request counts toward. See Usage.

Attached Files​

When a request carries files through the Agent Portal, a policy can test what they are and what they contain.

AttributeTypePresenceDescription
request.file_countIntAlways; 0 when noneHow many files the request carries. The safe way to ask whether this request carried a file at all.
request.filesListWhen the request carries filesOne entry per file. Absent when there are none, so request.files.exists(…) is a non-match on ordinary traffic.

Each entry in request.files has these fields:

FieldTypePresenceDescription
nameStringAlwaysFile name
mime_typeStringWhen knownFile type, such as application/pdf
size_bytesIntWhen knownSize in bytes
sha256StringWhen knownChecksum of the file's contents
parsed_charsIntWhen text was readHow many characters of text were read out of the file
truncatedBoolWhen text was readWhether reading stopped before the end of the file
textStringWhen text was readThe text read out of the file, up to a limit. Text beyond the limit is not checked, so a rule looking for a phrase near the end of a very long document may not find it.
sensitivity_labelMapOn an upload in the Agent PortalThe Microsoft Purview sensitivity label the file carries, and whether its format can carry one at all. See The Document's Sensitivity Label.

A file is checked twice: when it is uploaded, and again on the message that sends it to the agent.

  • At upload, name, mime_type, size_bytes and sha256 are the gateway's own measurement of the file. It reads the type from the contents, so a renamed attachment is measured for what it is.
  • On the send, those four fields describe what the caller says the file is.

Write rules about those four fields to act at upload. text is the content that actually reaches the agent, so a rule about text holds equally on both.

The text a rule reads is used for the check, and then discarded. It is never written to the audit trail or a log. The audit trail records a file's name, type, size, checksum, how many characters were read, whether reading stopped early, and any sensitivity label.

The Document's Sensitivity Label​

When a file is uploaded in the Agent Portal, AgentPass reads the Microsoft Purview sensitivity label the document carries. It offers the label to a policy as request.files[].sensitivity_label. A rule can then block anything marked Highly Confidential, or require every Office document to be classified before an agent reads it.

A label rule acts at upload, and nowhere else

sensitivity_label is AgentPass's own reading of the document it received, so it is present only on the upload. It is absent on the message that sends the file to Copilot or a Copilot Studio agent. A label there could only be something the caller claimed about the file, so AgentPass offers nothing.

A condition on an absent attribute is never true, so a label rule written for a send does nothing. Write label rules to act at upload. See Agent Portal Attachments for what else the upload checks.

The label carries these fields:

FieldTypePresenceDescription
stateStringAlways, on an uploadlabeled, unlabeled or not_applicable. See What the Three States Mean
idStringWhen the label carries an identifierThe label's identifier in Microsoft Purview. Prefer this over name in a rule you enforce.
nameStringWhen the label's name is on the documentThe label's display name, such as Highly Confidential
parent_idStringWhen the label is a sub-labelThe identifier of the label it sits under, so one rule covers a whole branch of your label taxonomy
sourceStringWhen a label was foundmsip_properties for Microsoft Purview's own stamp, label_info_part for the label information inside an unencrypted Office file, which carries the identifier but no name, or sensitivity_property for a plain sensitivity name a third-party tool wrote
protectedBoolOnly when the label states itWhether the label asserts rights protection. Purview does not normally record this on the document, so it is usually absent. Do not build a rule that depends on finding it.

What the Three States Mean​

state is the one field that is always there. Build a rule on it when you want an answer for every upload, not only the labeled ones. It takes three values:

StateMeaning
labeledThe document carries a sensitivity label. The other fields describe it.
unlabeledThe format can carry a sensitivity label, AgentPass looked, and there was none.
not_applicableThe format cannot carry an Office sensitivity label at all: plain text, Markdown, CSV, JSON, HTML and PDF.

not_applicable lets you require every Office document to be classified without also blocking every text file. state == 'unlabeled' reaches unclassified Word, Excel and PowerPoint documents, and leaves alone the formats that could never carry a label.

Prefer the Label's Identifier to Its Name​

name is what you recognize, such as Highly Confidential, which makes a rule easy to read. It also changes the moment somebody renames the label in Microsoft Purview, and a rule naming the old value stops matching.

An identifier does not change, so id is the better choice for a rule you rely on. Keep the label's name in the policy's Description, so the rule stays readable.

parent_id is set on a sub-label. A rule written against a parent label's identifier therefore covers every sub-label under it. You need not list each one, or re-edit the rule when your taxonomy grows.

Working conditions for all of this are in Policy Examples.

Response​

These attributes are present only on a Post-Response rule. During Pre-Request, the whole response map is empty, so each of them is absent.

AttributeTypePresenceDescription
response.statusIntPost-ResponseHTTP status code
response.headersMapPost-ResponseHTTP response headers
response.bodyMapPost-ResponseThe parsed JSON response body
response.latency_msIntPost-ResponseHow long the backend took to respond, in milliseconds

On a model provider connector, a Post-Response rule that reads only response.* holds the whole reply until it has run. See Governing Inference Traffic.

Connector​

These attributes are present on every request, whatever kind of connector handled it.

AttributeTypePresenceDescription
connector.nameStringAlwaysName of the connector handling this request
connector.templateStringAlwaysThe kind of connector: ANTHROPIC, OPENAI, AWS_BEDROCK, AWS_BEDROCK_MANTLE, AZURE_FOUNDRY (Microsoft Foundry), MCP_PROXY, REST_API, AWS_AGENTCORE, ANTHROPIC_MANAGED_AGENTS, M365_COPILOT, SLACK or CUSTOM
connector.onboarding_modeStringAlwaysHow the connector treats an agent that has not been onboarded: REQUIRE_APPROVAL, OBSERVE or DISABLED
connector.trustStringAlwaysWhether content this connector returns is trusted input: UNTRUSTED, the default, or TRUSTED. Reading from an UNTRUSTED connector sets session.untrusted

Lead with a connector.template guard on any rule that is specific to one kind of connector, such as connector.template == "AWS_BEDROCK" && …. The Connector field in the New policy wizard scopes the policy the same way. The guard makes the intent visible in the rule itself.

A connector with a data ceiling also carries connector.data_ceiling and connector.data_ceiling_rank. See Data Classification.

A Slack channel connector, SLACK, hands each message to the AWS Bedrock AgentCore agent it is bound to. A rule on that conversation is therefore written for the agent's connector, AWS_AGENTCORE.

The AWS Caller Behind a Bedrock Request​

On an AWS Bedrock connector, connector.aws.bedrock.* describes the AWS developer behind the request, as far as the gateway could identify them. It covers identity, credential, client and network. Only identity_source, credential_type and has_security_token are always present, and the rest arrive when resolved. Bedrock Caller Policies lists every attribute and the safe pattern for a block.

Microsoft 365 Copilot Details​

On a Microsoft 365 Copilot connector, connector.m365.copilot.* describes where the request came from:

  • The Agent Portal surface
  • The signed-in person
  • The Microsoft Entra tenant
  • The conversation
  • On a Copilot Studio turn, the agent it targets

Only surface is always present. Microsoft 365 Copilot Policies lists every attribute and the surface values.

Microsoft Foundry Details​

On a Microsoft Foundry connector, connector.azure.foundry.* describes how the developer reached Foundry: the credential type, the API surface (openai_v1, openai_deployments, anthropic or other), the deployment and API version, the Microsoft Entra tenant, person and application behind a sign-in, and the client's IP address. Policies on Foundry Traffic covers writing rules against them.

Data Classification​

tool.name and tool.connector are present on every tool call, labeled or not. Most of the others are present only when something classified the call, such as a label on the tool or connector this request reaches. The Presence column gives each case. Data Classification explains how a label is assigned, and how a call's effective classification is resolved.

AttributeTypePresenceDescription
tool.nameStringOn a tool callThe tool being called
tool.connectorStringOn a tool callThe connector providing it
tool.tier · tool.tier_rankString · IntWhen the tool is labeledThe tier assigned to the tool, and its rank
tool.tagsList of StringWhen the tool is labeledThe tags assigned to the tool
tool.sinkStringOn a tool callWhat the tool does with data: none, external_comms, state_change, credential or execute. For example, tool.sink in ['external_comms', 'state_change']
tool.sink_sourceStringOn a tool callHow the sink was decided: assigned, hint, name or default
data.tier · data.tier_rankString · IntWhen anything classified the callThe effective classification of this call, from the tool's labels, the connector default, any tag floor and the sensitivity label on an attached file
data.tagsList of StringWhen anything classified the callThe effective tags
data.sourcesListWhen anything classified the callWhat contributed the classification, and how. Each entry's origin is assignment (an administrator), external (a sensitivity label on a file), detected (content detection) or semantic (the optional classifier). Each entry also carries kind (TOOL, RULE or CONNECTOR) and detail, a readable description of the source. Use origin, not kind, to tell an assignment from a detection
data.scanStringWhen content detection scanned the callfull, or truncated (the payload exceeded the scan window, so part of it was not read)
data.semanticStringWhen the semantic tier is on and the call has arguments to classifyok, low_confidence, adversarial, unavailable, budget or withheld (not sent, because content detection found a credential inside a value)
data.confidenceDoubleWhen the classifier returned a confidenceThe classifier's confidence in its verdict
data.advisoryBoolOnly when trueThe verdict fell between Advise above and Act above. It still contributes to the classification, so an enforcing rule that should act only on confident verdicts can exclude it. A verdict below Advise above is low_confidence, recorded and never acted on
connector.data_ceiling · connector.data_ceiling_rankString · IntWhen a ceiling is set on the connectorThe highest classification this destination may receive
response.data.*—Post-Response, when the call is classified or its reply was scannedtier, tier_rank, tags, sources and scan only. The call's classification, raised by anything detection found in the reply, so it is never lower than data.*. When the reply was not scanned, it repeats the request's classification
A truncated scan is not a clean one

data.scan is reported separately from the tags, so "nothing was found" and "not all of it was read" stay distinguishable. A rule that must not pass unexamined content should test data.scan as well as the classification.

Compare tier_rank, not tier. Tier names are yours to rename, and a rule naming one stops matching the day somebody does. The rank survives a rename.

Ranks start at 1. A call that nothing classified carries no data.tier, data.tier_rank, data.tags or data.sources, not a rank of 0. A condition on them is therefore a non-match, not a comparison against zero. Such a call can still carry data.scan and the semantic attributes.

Session​

These attributes are present when session tracking is on, and the caller could be identified. They are available on the Pre-Request phase, on MCP and REST API connectors. They describe what the call's session read before this call. The call itself is described by data. Session Tracking explains what counts as a session and which calls contribute.

AttributeTypePresenceDescription
session.tier_rankIntWhen session tracking identified the callerRank of the most sensitive tier the session has read; 0 when it has read nothing classified
session.tierStringWhen session.tier_rank is above 0The key of that tier
session.tagsList of StringWhen session tracking identified the callerEvery tag the session has read
session.connectorsList of StringWhen session tracking identified the callerEvery connector the session has called, classified or not
session.contributionsIntWhen session tracking identified the callerHow many calls have counted toward the session
session.key_kindStringWhen session tracking identified the callerHow the session was identified, from the most specific to the broadest: agentcore_session (one AWS Bedrock AgentCore conversation), cma_session (one Anthropic managed-agent session), endpoint_session (one agent session on a managed desktop, attested by the device), agent_identity (every session of one agent credential) or user (everything one person does within the idle window)
session.untrustedBoolOnly when trueThe session read content from an untrusted source earlier. Test it with has(session.untrusted)
session.hostileBoolOnly when trueThe session read content judged hostile
session.untrusted_sourcesList of StringWhen the session read an untrusted sourceThe connector/tool of each untrusted source the session read
session.quarantinedBoolOnly when trueThe session is paused. The same fact as session.control == 'paused', which new rules should prefer
session.controlStringWhen the session is paused or terminatedThe session's control state: paused or terminated. Absent while the session is active, which is the default
session.postureMapWhen the request carries a verified device attestation from a managed desktopThe desktop's reported posture. Its fields are sandbox, bypass_mode, managed_hooks, mcp_pins_ok and memory_pins_ok, each a Bool, and agent_version, a String. A field the desktop did not report is absent. Test for an attested desktop with has(session.posture)

The whole session map is absent on the Post-Response phase, on any other kind of connector, when tracking is off, when nothing identifies the caller, or when the session record cannot be read in time. As everywhere, an absent attribute is a non-match, so a session rule steps aside rather than blocking.

A paused or terminated session is already frozen by the gateway before any policy runs. You do not need a policy to enforce the freeze. session.control lets a condition read the state, or record it alongside other facts. See Pausing and Stopping a Session.

session.posture is what the managed desktop reports about itself. Use it alongside other conditions, rather than as the only test in a block.

Usage​

These attributes carry today's model spend of the request's person and agent, counted from 00:00 UTC. They are present on the Pre-Request phase of a request that runs a model, on Anthropic, OpenAI, AWS Bedrock and Microsoft Foundry connectors. Daily Spend Limits explains how spend is counted.

AttributeTypePresenceDescription
usage.availableBoolOn a request that runs a modeltrue when today's spend could be read
usage.user.cost_usd.dayDoubleWhen usage.available is true and the request has a personWhat the person's agents have spent today, in US dollars
usage.user.requests.dayIntWhen usage.available is true and the request has a personThe person's model requests today
usage.agent.cost_usd.dayDoubleWhen usage.available is true and the request has an agentWhat this agent has spent today, in US dollars
usage.agent.requests.dayIntWhen usage.available is true and the request has an agentThis agent's model requests today

A whole number compares with a cost, so usage.user.cost_usd.day > 25 is valid. Start a condition with usage.available, as the rule a spend limit writes does:

Hold anyone in one group who has spent more than $25.00 today — Pre-Request
usage.available && request.user_groups.exists(g, g in ['Delta Team']) && usage.user.cost_usd.day > 25.0

A rule you write this way holds or stops at the amount in the rule. Only a spend limit can be raised for a day.

Content​

content.injection.* is the injection detector's reading of a tool's response. It is available to a Post-Response rule. The whole map is absent unless the detector found something.

AttributeTypePresenceDescription
content.injection.statusStringWhen the detector found somethingclean, finding or truncated
content.injection.scoreIntWhen the detector found somethingHow many injection signals it found
content.injection.findingsList of StringWhen the detector found somethingThe name of each finding, such as unicode_tags, override_instructions or hidden_html_instruction

A hostile finding already sets session.hostile for the rest of the session. Use content.injection.* for a rule about the response itself.

Inference​

On a connector that reaches a model, a policy reads a normalized view of the conversation. One rule therefore works the same whichever provider is behind the connector. The model connectors are Anthropic, OpenAI, AWS Bedrock, AWS Bedrock Mantle, Microsoft Foundry and, in part, Microsoft 365 Copilot.

On any other connector, the whole inference map is empty, and each of these attributes is absent. An inference rule scoped to the wrong connector therefore matches nothing, not everything.

You do not need this section to write an inference rule. Describe your goal in plain English, and the gateway drafts it, as described in Authoring a Policy with AI. Use this section to read a draft closely, or to write a rule by hand.

Check the Newest Message, Not the Whole Conversation​

An inference request carries the entire conversation. Every time an agent takes another step, it resends every turn so far. A rule that matches anywhere in that conversation keeps matching on every later turn. A prompt the gateway blocked is left out of later requests, but everything else in the conversation is checked again each time.

The inference.latest_turn attributes scope a rule to the newest message only. A rule written against them fires once, on the turn that introduced the content. Evaluation also stays quick, because the text checked is one turn, not the whole history.

tip

Prefer inference.latest_turn.text over matching the conversation as a whole. It is what makes a rule fire once instead of repeatedly.

Request Attributes​

These attributes describe what the agent sent. They are available to a rule in either phase.

AttributeTypePresenceDescription
inference.providerStringInference connectorsanthropic, openai, bedrock, azure or m365_copilot. AWS Bedrock and AWS Bedrock Mantle connectors both report bedrock. Microsoft Foundry connectors report azure, whichever API format the request uses
inference.modelStringWhen the request names oneModel being called
inference.systemStringWhen there is oneSystem prompt, flattened. On Anthropic connectors, and on AWS Bedrock requests in Anthropic's message format, it also includes the text of any system message inside the conversation
inference.turn_countIntInference connectorsMessages in the conversation so far. On Anthropic connectors, and on AWS Bedrock requests in Anthropic's message format, it counts user and assistant messages only. On an OpenAI connector, it counts every message
inference.toolsList of StringInference connectorsTools the agent says it can run
inference.latest_turn.roleStringWhen there is a turnWho sent the newest message, such as user or assistant. On an OpenAI connector, a tool's output arrives as tool. Anthropic and AWS Bedrock carry a tool's output in a user turn
inference.latest_turn.textStringWhen there is a turnText of the newest message only. Use this instead of the whole conversation.
inference.latest_turn.tool_resultsList of {tool_name, input_json, content}When there is a turnOutput the agent fed back after running a tool on its own machine. tool_name is the tool, and the file path or command it was given is in input_json.

Reply Attributes​

These attributes describe what the model sent back. They are available to a Post-Response rule.

AttributeTypePresenceDescription
inference.tool_usesList of {name, input_json}Post-ResponseTools the model is asking to run. Use this to stop dangerous commands.
inference.completion.textStringPost-ResponseThe model's reply text
inference.completion.stop_reasonStringPost-ResponseWhy the model stopped

Enforcing a rule that reads these stops the reply at the tool call. See Governing Inference Traffic.

Tool Names and Tool Arguments​

A tool call has two parts, and rules generally need the second one.

tool_name on inference.latest_turn.tool_results, and name on inference.tool_uses, is the tool, such as Read or Bash. What the tool was asked to act on, such as the file path or the shell command, is in input_json.

A rule that looks for a credential read therefore matches on input_json. The tool name is Read for every read the agent makes, whatever the file. Shell commands work the same way: the tool name is Bash whether the command is harmless or destructive, and the command itself is in input_json.

Field names differ

Tool results use tool_name, and tool uses use name.

On a Microsoft 365 Copilot Connector​

Microsoft's relay hands the gateway a prompt and a reply, not a provider conversation. A Copilot connector therefore fills only part of this namespace:

AttributesOn a Copilot connector
inference.provider, inference.latest_turn.text, inference.completion.textCarry a real value: m365_copilot, the message the user just sent, and Copilot's reply
inference.turn_count, inference.latest_turn.rolePresent, but always 1 and user, because the relay sends the newest message alone
inference.model, inference.systemNever arrive. A rule on either never fires on a Copilot connector.
inference.tools, inference.latest_turn.tool_results, inference.tool_usesPresent, but always empty lists
inference.completion.stop_reasonPresent, but always an empty string

Adding a reply-side rule to a Copilot connector changes how replies arrive for everyone using it. See Checking What Copilot Replies before you enable one.