An agent in a session can complete the same sensitive actions as a person, such as logging in or submitting a payment. Agent Intelligence monitors this activity and writes it to the session. This guide describes how to integrate Agent Governance with Agent Intelligence and obtain a decision based on that session data. Your application can then block the request, require step-up, or limit what the session can do, depending on which agent it is and whether a human is involved.
To retrieve the session from your backend, see Retrieve session data. Agent Governance is for cases where you want Mosaic to evaluate your governance policy and return an outcome.
- An agent loads the page. The SDK initializes with
agenticCollect: trueandenableSessionToken: true, and writes the session token to a cookie on your domain. - The agent browses pages and performs actions while Agent Intelligence monitors this activity and writes it to the session.
- When your backend needs a decision, such as at login, payment, or another sensitive request, it calls Governance with the session token.
- Governance reads the session from Agent Intelligence, runs the rules you enforced, and returns Allow, Deny, or Challenge.
- Your backend applies that outcome in the app, for example, blocks an agent or forces step-up authentication.
- A Mosaic application with client credentials. Create an application in the Admin Portal if you do not already have one.
- The Execute rule sets permission granted to that client. Without it, a client cannot obtain decisions.
- Agent Intelligence integration. If you already use Mosaic Fraud Prevention, keep the same
clientIdand the same region inserverPath.
Modify your Agent Intelligence integration to enable session token generation. Set enableSessionToken: true in the same SDK configuration that enables Agent Intelligence. The SDK then writes the session token to the ts_asc cookie on your site's parent domain, so a backend on another subdomain of that site receives the cookie with the request.
Add the flag inside drs, next to agenticCollect:
drs: {
agenticCollect: true, // Enables Agent Intelligence detection
enableSessionToken: true, // Writes the session token cookie for your backend
serverPath: 'https://api.transmitsecurity.io/risk-collect/', // Set serverPath based on your region or custom domain
}If your API is on a different site, the browser does not send the cookie. Read the token in the page and pass it to your backend in a header or field your API accepts. With the Platform SDK in your application code, you can read it with getSessionToken().
In the Admin Portal, go to Agentic Trust > Agent Governance > Policy Management and create a ruleset on Agent Intelligence data. A policy is the governance principle for what your application allows. You create it by creating a ruleset: a collection of rules, each with a condition on an Agent Intelligence signal and a result of Allow, Challenge, or Deny. For the concepts, see How policies work; for the full workflow, see Manage policies.
Publish the ruleset in Enforce so Agent Governance acts on it when your backend asks for a decision. Note the ruleset ID for the next step.
Call Governance APIs from your backend when you need a decision. Authorize the call with a client access token generated from your client credentials. The token must be issued to the same client as the clientId query parameter.
Send POST /ido/api/v2/decisioning/rule-sets/[RULESET_ID]/evaluate?clientId=[CLIENT_ID], where [RULESET_ID] is the UUID of a ruleset published to Enforce and [CLIENT_ID] is your client ID. In the request body, specify AGENT_INTELLIGENCE as a source and provide additional parameters.
Put the session token and any context under sources.AGENT_INTELLIGENCE. session_token is required. The other fields are optional but your rules can use them for decisioning, for example, action_type and claimed_user_id.
A field sent at the top level of the body is ignored. The ruleset then has no session data, data_unavailable is true, and the decision falls through to Allow. An unknown key under sources returns 400.
// Update the API host to match your region or custom domain
const resp = await fetch(
'https://api.transmitsecurity.io/ido/api/v2/decisioning/rule-sets/[RULESET_ID]/evaluate?clientId=[CLIENT_ID]',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer [ACCESS_TOKEN]', // Client credentials token of [CLIENT_ID]
},
body: JSON.stringify({
sources: {
AGENT_INTELLIGENCE: {
session_token: '[SESSION_TOKEN]', // Required. Value of the ts_asc cookie
action_type: 'transaction', // Optional. The type of action, such as login, transaction
correlation_id: '[CORRELATION_ID]', // Optional
claimed_user_id: '[HASHED_USER_ID]', // Optional. Must be hashed. Do not send an email address, phone number, or other plain-text personal data
claimed_user_id_type: 'account_id', // Optional
auth_context: {
user_id: '[USER_ID]', // Optional. ID of logged-in user
auth_method: 'webauthn', // Optional
failed_attempts: 0, // Optional
},
},
},
}),
}
);A successful response looks like this:
{
"error_code": 0,
"error_message": "",
"data": {
"evaluation_id": "[EVALUATION_ID]",
"decision": "Allow",
"matched_rule": { "id": "[RULE_ID]", "name": "Rule 1" },
"data_unavailable": false,
"degraded": false
},
"headers": []
}data contains:
evaluation_id, unique to this call. It is also returned on errors, which helps when you contact support.decision: Allow, Deny, or Challenge.matched_rule: theidandnameof the rule that matched, ornullwhen no rule matched. The decision is then the default Allow.data_unavailable:truewhen the ruleset needs Agent Intelligence data and it was not sent. The decision is then made without that data.degraded:truewhen the decision did not come from the Enforce rules. For example, the ruleset only has a Monitor version, or an internal failure occurred. The decision is then the default Allow.
The response does not include the Agent Intelligence session, the context you sent, or a session ID. Trust Allow only when data_unavailable and degraded are both false.
Errors use the same envelope, with a non-zero error_code:
400/17: the ruleset ID is malformed, or the body is invalid (for example,session_tokenis missing, or an unknown key undersources).400/18102: Agent Intelligence rejected the session token (expired or invalid, it belongs to another tenant, there is no current session, or the session ended), or the Agent Intelligence session endpoint is not enabled for the tenant.401/5000: theAuthorizationheader is missing.401/5001: the access token is invalid or expired, it was not issued toclientId, or it belongs to another tenant.403/17000:clientIdis missing.403/5010: the client does not have the Execute rule sets permission.404/18101: the ruleset was not found.404/24: Agent Governance is not enabled for the tenant.500/18106: an internal error.502/18105: an unexpected response from Agent Intelligence.503/18103: Agent Intelligence timed out.503/18104: Agent Intelligence is unavailable or rate-limited. You can retry.
Apply decision in your application. Mosaic does not block, redirect, or step up the interaction for you.
- Allow continues the action. Continue only when
data_unavailableanddegradedare bothfalse. - Deny stops the request.
- Challenge requires a stronger check before the action continues.
Use the same outcome values your rules return, and keep the enforcement in the backend.