The gate policy for a scope
const url = 'https://example.com/v1/agents/example/gate-policy?scopeKind=tenant';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/agents/example/gate-policy?scopeKind=tenant' \ --header 'Authorization: Bearer <token>'The gate policy a promotion of the agent for the scope would be checked against: the most specific scope with an active policy (a segment path’s longer prefixes first, then its project, the project’s org, the tenant), at its latest active version. policy: null when none applies.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”AgentId — dotted namespace (acme.drafting).
Query Parameters
Section titled “Query Parameters”Only one scope: tenant, org or project (with scopeId), or segment (with scopeId and segment).
Required IF scopeKind is org or project. MUST be absent if scopeKind=tenant (tenant is implicit from the session). Malformed combinations return 400 scope-invalid.
One step of the segment path, key:value; repeat it in order, coarse to fine.
Responses
Section titled “Responses”The policy, or null.
object
object
The agent’s default for the whole tenant.
object
An org’s projects.
object
One project.
object
A segment path within a project: it covers every run whose path starts with it.
object
object
Lowercase, like an identifier: company, contact-role.
What a promotion must show. Every part is optional; an empty spec checks nothing. A promotion must name a comparison (evalRunId) exactly when the spec has comparison, evidence, metrics, replay or onlyRestrictedClasses. Unknown keys are refused.
object
object
object
The judged evidence behind each gated metric; for a metric with maxDrop, the baseline’s too.
object
object
weightedPrecisionAtK only: the summary’s k must be this.
How far the candidate may fall below the baseline (the live version).
Each knob left out of the block is 0. No block: no replay checks.
object
A passing promotion waits for a reviewer.
object
Default senior.
Default true.
Only restricted judge classes count: the comparison must be weighted restricted-only, so a class anyone may assert can’t move the gate.
Example
{ "policy": { "scope": { "kind": "tenant" }, "spec": { "metrics": [ { "name": "weightedYesShare" } ], "approvals": { "role": "standard" } } }}Missing or malformed scope.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}