PATH 02 · AGENT IDENTITY · ONE FIELD
The identity Okta issued, inside every judgment
With Agent SSO and Cross App Access the agent carries an Okta-issued identity into every app it reaches, and Auth0’s Token Vault does the same for agents outside the workforce. Carry that identity into the judgment: the tool handler verifies the token Okta issued, takes the agent identity from its claims and the agent’s authority from your own configuration — never from the request — posts the proposed action to Veridect with that identity as the calling agent, and uses the brokered credential only on a greenlight. The record is keyed to the same identity your System Log shows.
~30 lines · verified token, configured authority · the credential unchanged
Where the authority lives: the scope string is the agent’s configured authority — the words your access policy already uses, looked up by the verified agent identity, so neither the model nor a caller can widen it. A read-only access-review agent that proposes to deactivate a user is a categorical no-authority action — the deterministic layer blocks it before any model is asked to weigh in. Watch it below. The policy classes work over field names; send values only for the fields your policy needs.
// the agent's tool handler — identity from Okta (verified), authority from configuration, judgment from Veridect
import { jwtVerify, createRemoteJWKSet } from "jose";
const OKTA_ISSUER = "https://<your-org>.okta.com/oauth2/<authorization-server>";
const JWKS = createRemoteJWKSet(new URL(OKTA_ISSUER + "/v1/keys"));
const AGENT_AUTHORITY = { // the agent's configured authority, keyed by its Okta identity — never taken from the request
"0oa…helpdesk-agent": "may read users and groups and may update membership of standard application groups below the privileged tier",
"0oa…access-review": "read-only: may read users, groups, sign-in history and app assignments to draft access-review summaries",
};
async function governedIdentityAction(oktaToken, downstreamToken, proposal) {
const { payload: t } = await jwtVerify(oktaToken, JWKS, { issuer: OKTA_ISSUER, audience: "api://identity-tools" }); // signature, issuer, audience, expiry
const callingAgent = t.act?.sub ?? t.sub; // delegated token: act.sub is the agent, sub is the person it acts for; agent's own token: sub is the agent
const actingFor = t.act ? t.sub : "none";
const scope = AGENT_AUTHORITY[callingAgent];
if (!scope) return { executed: false, verdict: "unknown_agent", recordId: "" }; // no configured authority → never asked, never run
let verdict = "unavailable", recordId = ""; // closed until proven open
try {
const r = await fetch("https://<your-veridect-host>/api/ai/consensus/pre-action", {
method: "POST", signal: AbortSignal.timeout(60000),
headers: { "Content-Type": "application/json", Authorization: "Bearer " + process.env.VERIDECT_API_KEY },
body: JSON.stringify({
action: proposal.action, target: proposal.target, parameters: proposal.parameters,
callingAgent, callingAgentScope: scope,
context: "acting for " + actingFor + "; " + proposal.reason,
department: "identity_operations" }) });
const d = r.ok ? await r.json() : {};
verdict = d.verdict ?? "unavailable"; recordId = d.auditBundleId ?? "";
} catch { /* network, timeout, parse: all stay closed */ }
if (verdict !== "greenlight") return { executed: false, verdict, recordId };
const result = await callDownstream(proposal, downstreamToken, { "X-Veridect-Record": recordId }); // the brokered credential, used once
return { executed: true, verdict, recordId, result };
}