dots.v2.agents.sessions.policy.validate.post()
Generated on 27 Oct 2026
from DoTs version
v1.21.0
Usage
client.v2.agents.sessions.policy.validate.post(body: undefined | ArrayBuffer, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Validation_result>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
The request body uses application/x-yaml.
apiVersionstring optionalExample:
agents.digitalocean.com/v1alpha1Legacy envelope only - must be "agents.digitalocean.com/v1alpha1", and its presence is what routes the document to the deprecated legacy parser. Flat-format manifests carry no version key (the endpoint owns the contract); required, with kind and spec, when authoring the legacy format.
kindstring optionalExample:
AgentMust be "Agent".
metadataobject optionalShow child properties
namestring optionalExample:
exampleOptional team-unique session name: 1-64 chars of letters, digits, '-', '.', '_', starting and ending alphanumeric; case-insensitive; must not be UUID-shaped. Omit to have the control plane generate one ("session-<agent-type>-<date-time>"). Unique among the team's ACTIVE (non-terminal) sessions; destroying a session frees its name for reuse.
descriptionstring optionalExample:
Use when ...Free-form description (max 1024 chars), stored and echoed back for Console / catalog surfaces.
labelsobject optionalExample:
{}
specobject optionalShow child properties
permissionsobject optionalCustomer-declared tool-execution permission policy (spec.permissions). REQUEST only: the policy engine resolves it (∩ tenant ∩ platform) into the canonical policy and validates it against the (agent, version) capability descriptor. Absent or empty means the agent keeps its built-in default gating, no policy is shipped to the sandbox.
Show child properties
defaultActionstring optionalDisposition for tool calls that match no rule. Defaults to "ask" when omitted.
rulesarray of objects optionalOrdered match→action rules. Declared order is authoritative: the LAST matching rule wins (author-order last-match).
Show child properties
toolstring requiredExample:
exampleTool taxonomy this rule matches (e.g. bash, file.read, file.write, web.fetch, git.*, mcp).
matchobject optionalOptional keys narrowing the rule (e.g. {"command": "npm run deploy"} for bash). Values are globs and must not contain shell-style ${VAR}/$VAR expansions.
actionstring requiredenforcementstring optionalWhat happens when the agent cannot enforce the rule exactly. "strict" rejects the session; "best-effort" degrades to the closest more-restrictive form and warns (never widens). Defaults to strict for deny rules, best-effort otherwise.
filesystemobject optionalFilesystem boundary, enforced by the microVM (read-only root + bind-mounted writable roots) for every agent.
Show child properties
modestring optionalallowWritearray of strings optionalExample:
["example"]Additional writable paths beyond the workspace. Values must not contain shell-style ${VAR}/$VAR expansions.
networkobject optionalNetwork boundary. Narrows (subtract-only) spec.sandbox.egress; link-local/internal addresses stay blocked by the broader egress policy.
Show child properties
defaultEscapedstring optionalallowarray of strings optionalExample:
["example"]
modestring optionalExplicit lifecycle discriminator. Defaults to "interactive" (spec.serving forbidden); "served" requires spec.serving.
runtimeobject requiredCanonical adapter ids: claude-code | opencode | codex | cursor | hermes | codex-agentapi | custom. codex-agentapi is the OpenAI sandbox-provider runtime (DO runs codex exec-server; the agent loop lives at OpenAI) and pairs with the opaque spec.runtime.config block. codex-cli and cursor-cli are deprecated aliases (accepted with a create-time warning). The framework adapters (openai-agents, claude-agent-sdk, crewai, langgraph) are declared but not yet supported; CreateSession rejects them. adapter: custom requires the custom block.
workspaceobject optionalRepositories the session works against.
sandboxobject optionalmodelobject optionalAccepted, not yet enforced (returns a warning). Model routing (Plano); catalog-validated when enforcement lands.
toolsobject optionalAccepted, not yet enforced (returns a warning). Exactly one of mcpServers or bundle.
skillsarray of objects optionalInline agent skills (SKILL.md shape): reusable markdown instructions the agent loads on demand, selected by description. Accepted, not yet enforced (returns a warning). Max 32 entries; instructions additionally capped at 256 KiB summed across the list so a valid manifest always fits the request-body limits. v0 is inline-only - remote skill sources come later as an additive field.
envobject optionalExample:
{}Non-secret guest env (debug-readable - never put secrets here; use spec.secrets). Reserved platform keys (TEAM_ID, SESSION_ID, SANDBOX_ID, CONTROL_PLANE_CALLBACK_URL, SANDBOX_TEMPLATE, SANDBOX_AGENT_WORKDIR, SIZE_SLUG, SANDBOX_IMAGE_ID, SANDBOX_OCI_REF, PLANO_PERMISSION_*) are rejected. Credential-looking values (dop_v1_..., sk-..., ghp_...) trigger a create-time warning.
memoryobject optionalAccepted, not yet enforced (returns a warning).
secretsarray of objects optionalDeclared credential requirements. source tenantSecret is enforced today: value is write-only plaintext, extracted into Secrets Manager at create and never persisted or returned. source oauth requires provider, carries no value, and is accepted but not yet enforced. ref is legacy and ignored. env false keeps the resolved value out of the guest environment (mount-only slots).
defaultsobject optionalservingobject optionalPresent only when spec.mode is "served" (autoscaled fleet).
Response Example
More Information
See /v2/agents/sessions/policy/validate in the API reference for additional detail on responses, headers, parameters, and more.