pydo.harness.validate_session_policy()

Generated on 13 Nov 2026 from pydo version v0.46.0

Usage

client.harness.validate_session_policy(body={...})
Returns JSON Raises HttpResponseError

Description

Stateless preflight: parses the same environment spec as CreateSession and runs the identical resolve + validate pipeline against the capability descriptor stamped on the selected template’s image (resolved per-request via the sandbox, not a separate registry). Returns per-rule verdicts. Nothing is provisioned or persisted.

Each rule is validated against the descriptor for the (agent, version) the template resolves to and gets a verdict: exact, degraded, unsupported, or unverified. ok is false when any strict rule is unsupported or unverified — i.e. CreateSession would reject the policy for that agent. An empty spec.permissions returns ok: true with no verdicts. Because it shares the create path’s descriptor lookup, the verdicts match what CreateSession would compute.

Parameters

body JSON or IO[bytes] required

The same environment spec you would submit to CreateSession (YAML). Only agent/template selection and the permissions block are used. The live API also accepts application/yaml, text/yaml, and text/x-yaml; OpenAPI content lists a single media type so generated clients can emit this operation.

Response Example

Show Response Example
{
  "agent": "example",
  "version": "example",
  "ok": true,
  "defaultAction": "allow",
  "defaultActionVerdict": "exact",
  "defaultActionRendered": "allow",
  "defaultActionReason": "example",
  "verdicts": [
    {
      "verdict": "exact",
      "rendered": "allow",
      "reason": "example",
      "suggestion": "example"
    }
  ]
}

More Information

See /v2/agents/sessions/policy/validate in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.