Skip to main content
Glama

Advanced: attach session policy

runtime_session_policy

Set allow rules on an open session to define which slugs and ops it may run before exec.

Instructions

[advanced/internal] Attach allow rules on an already-open raw session (allow_slugs / allow_ops). Policy overlay — not open and not exec. Identity remains Aziel Eliab. Use this when an already-open session needs tighter allow_slugs / allow_ops before exec. Do not use it for executing an op or opening a session; use runtime_session_exec or runtime_session_open (prefer fraggate_call, which applies defaults) instead. Write: mutates session policy only. A sealed session refuses session_closed (409). Expired sessions refuse session_expired (410). Missing both session_id and id fails before the door runs. Does not exec and does not mint a new id. session_id or id (aliases) required. allow_slugs / allow_ops replace the allow overlay when sent; omit them to leave the current lists. max_payload_bytes and kv_increment are optional overlays, not exec payload. Nested policy{} is accepted as the same overlay. Mutation requires confirm=true (runtime gate) or dry_run=true (preview only, no write). confirm and dry_run stay optional on inputSchema.required. dry_run still returns FG-HALLUC-TOOL, FG-STUB, FG-UNKNOWN-OP, or FG-LOCAL-ONLY when a confirm call would refuse. confirm is consent, not tenant auth, and it does not upgrade shared public-demo isolation. Returns updated session policy plus a policy receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoAlias of session_id. The door accepts either key; do not send two different values.
confirmNoDocumented confirmation flag. Optional in inputSchema.required (connector refresh must not break). tools/call still refuses MCP-CONFIRM-REQUIRED when confirm is missing or false unless dry_run=true. confirm is consent to run the call. It is not tenant auth and it does not upgrade shared public-demo isolation.
dry_runNoOptional preview flag. When true, do not write and do not stamp a ledger tip. Allowlist, hallucination, stub, and local-only checks still run and return the same FragGate refuse code a confirm call would get. MCP-DRY-RUN is returned only when that call would have been allowed to proceed. confirm is consent, not tenant auth, and it does not upgrade shared public-demo isolation.
allow_opsNoOptional replacement allowlist of ops this session may exec. Omit to keep the current list.
session_idYesRequired. Raw session id from runtime_session_open (sess_ + 32 lowercase hex). Alias: id. Missing both fails with session_id required; unknown id returns session_not_found.
allow_slugsNoOptional replacement allowlist of catalog slugs this session may exec. Omit to keep the current list.
kv_incrementNoOptional. When true, allow KV increment side effects on later exec. Not an increment itself.
max_payload_bytesNoOptional max payload size in bytes for later exec (integer 1..1048576). Overlay only; not the exec body. Out of range refuses bad_policy.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoFragGate or fabric code when present: FG-OK, FG-HALLUC-TOOL, FG-STUB, FG-LOCAL-ONLY, FG-UNKNOWN-OP, FG-GATE-REFUSE, FG-LAMB-REFUSE, or a module refuse such as MESH-* / AKM-*.
doorNoDoor name. The public door is fraggate.
ran_inNoExecution locale (for example aziel-runtime) when present.
resultNoPolicy body: updated session allow lists and a policy receipt. Refuses session_id required, session_not_found, session_closed, session_expired.
statusNoHTTP-like status when present on wrappers (200 ok; 400+ error / refuse).
displayNoHuman-facing envelope. Show title and summary, then take the next input.
receiptNoOptional receipt, ledger tip, or TemporalLock/ForgeReceipts exit when the door stamped one.
refusalNoExplicit refuse object, code, or message when the door or engine refused.
engine_opNoResolved engine op when present (often inside result).
ledger_tipNoAsk/refuse ledger tip when the door stamped one.
provenanceNoProvenance / input packet when the pipeline attached one.
session_idNoRaw session id when session plumbing was used. Hidden unless the user asked for the chain.
engine_slugNoResolved engine slug when present (often inside result).
limitationsNoCapability limitations or Remain-OFF notes when present.
engine_digestNo64-hex engine_digest when a true in-process engine ran (often inside result).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.8
    • changedInput schema / properties / confirm / description
      Previous value: -"Documented confirmation flag. Optional in inputSchema.required (connector refresh must not break). tools/call still refuses MCP-CONFIRM-REQUIRED when confirm is missing or false unless dry_run=true (preview, no write)."New value: +"Documented confirmation flag. Optional in inputSchema.required (connector refresh must not break). tools/call still refuses MCP-CONFIRM-REQUIRED when confirm is missing or false unless dry_run=true. confirm is consent to run the call. It is not tenant auth and it does not upgrade shared public-demo isolation."
    • changedInput schema / properties / dry_run / description
      Previous value: -"Optional preview flag. When true, return a would-mutate preview and do not write. Alternative to confirm=true. Does not mutate."New value: +"Optional preview flag. When true, do not write and do not stamp a ledger tip. Allowlist, hallucination, stub, and local-only checks still run and return the same FragGate refuse code a confirm call would get. MCP-DRY-RUN is returned only when that call would have been allowed to proceed. confirm is consent, not tenant auth, and it does not upgrade shared public-demo isolation."
  2. Changed3 schema fields changedv2.0.2
    • changedInput schema / description
      Previous value: -"session_id or id required. Other fields are optional policy overlays (also accepted nested under policy)."New value: +"session_id or id required. Other fields are optional policy overlays (also accepted nested under policy). Mutation requires confirm=true or dry_run=true."
    • addedInput schema / properties / confirm
      Added value: +{
      +  "description": "Documented confirmation flag. Optional in inputSchema.required (connector refresh must not break). tools/call still refuses MCP-CONFIRM-REQUIRED when confirm is missing or false unless dry_run=true (preview, no write).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / dry_run
      Added value: +{
      +  "description": "Optional preview flag. When true, return a would-mutate preview and do not write. Alternative to confirm=true. Does not mutate.",
      +  "type": "boolean"
      +}
  3. Changed11 schema fields changedv2.0.1
    • changedInput schema / description
      Previous value: -"session_id is required. Other fields are optional policy overlays."New value: +"session_id or id required. Other fields are optional policy overlays (also accepted nested under policy)."
    • changedInput schema / properties / allow_ops / description
      Previous value: -"Optional allowlist of ops this session may exec."New value: +"Optional replacement allowlist of ops this session may exec. Omit to keep the current list."
    • changedInput schema / properties / allow_slugs / description
      Previous value: -"Optional allowlist of catalog slugs this session may exec."New value: +"Optional replacement allowlist of catalog slugs this session may exec. Omit to keep the current list."
    • addedInput schema / properties / id
      Added value: +{
      +  "description": "Alias of session_id. The door accepts either key; do not send two different values.",
      +  "pattern": "^sess_[a-f0-9]{32}$",
      +  "type": "string"
      +}
    • changedInput schema / properties / kv_increment / description
      Previous value: -"Optional. When true, allow KV increment side effects on this session."New value: +"Optional. When true, allow KV increment side effects on later exec. Not an increment itself."
    • changedInput schema / properties / max_payload_bytes / description
      Previous value: -"Optional max payload size in bytes for later exec."New value: +"Optional max payload size in bytes for later exec (integer 1..1048576). Overlay only; not the exec body. Out of range refuses bad_policy."
    • addedInput schema / properties / max_payload_bytes / maximum
      Added value: +1048576
    • addedInput schema / properties / max_payload_bytes / minimum
      Added value: +1
    • changedInput schema / properties / session_id / description
      Previous value: -"Required raw session id from runtime_session_open. Alias: id."New value: +"Required. Raw session id from runtime_session_open (sess_ + 32 lowercase hex). Alias: id. Missing both fails with session_id required; unknown id returns session_not_found."
    • addedInput schema / properties / session_id / pattern
      Added value: +"^sess_[a-f0-9]{32}$"
    • changedOutput schema / properties / result / description
      Previous value: -"Machine payload. FragGate-style results commonly include ok, code, slug, op, status, engine_slug, engine_op, engine_digest, ran_in, provenance, refusal, limitations, and ledger_tip."New value: +"Policy body: updated session allow lists and a policy receipt. Refuses session_id required, session_not_found, session_closed, session_expired."
  4. Changed7 schema fields changedv1.6.2
    • addedInput schema / description
      Added value: +"session_id is required. Other fields are optional policy overlays."
    • addedInput schema / properties / allow_ops / description
      Added value: +"Optional allowlist of ops this session may exec."
    • addedInput schema / properties / allow_slugs / description
      Added value: +"Optional allowlist of catalog slugs this session may exec."
    • addedInput schema / properties / kv_increment / description
      Added value: +"Optional. When true, allow KV increment side effects on this session."
    • addedInput schema / properties / max_payload_bytes / description
      Added value: +"Optional max payload size in bytes for later exec."
    • addedInput schema / properties / session_id / description
      Added value: +"Required raw session id from runtime_session_open. Alias: id."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "Display envelope shown to the user (display.title / display.summary) plus the machine result. Extra engine fields may appear.",
      +  "properties": {
      +    "code": {
      +      "description": "FragGate or fabric code when present: FG-OK, FG-HALLUC-TOOL, FG-STUB, FG-LOCAL-ONLY, FG-UNKNOWN-OP, FG-GATE-REFUSE, FG-LAMB-REFUSE, or a module refuse such as MESH-* / AKM-*.",
      +      "type": "string"
      +    },
      +    "display": {
      +      "additionalProperties": true,
      +      "description": "Human-facing envelope. Show title and summary, then take the next input.",
      +      "properties": {
      +        "fields": {
      +          "description": "Optional labeled scalars copied from the result for display.",
      +          "items": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "label": {
      +                "description": "Field label.",
      +                "type": "string"
      +              },
      +              "value": {
      +                "description": "Field value as text.",
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "next": {
      +          "description": "What the agent should do after showing this output.",
      +          "type": "string"
      +        },
      +        "summary": {
      +          "description": "One-line outcome or refuse reason.",
      +          "type": "string"
      +        },
      +        "title": {
      +          "description": "Short result title for the AI client.",
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "door": {
      +      "description": "Door name. The public door is fraggate.",
      +      "type": "string"
      +    },
      +    "engine_digest": {
      +      "description": "64-hex engine_digest when a true in-process engine ran (often inside result).",
      +      "type": "string"
      +    },
      +    "engine_op": {
      +      "description": "Resolved engine op when present (often inside result).",
      +      "type": "string"
      +    },
      +    "engine_slug": {
      +      "description": "Resolved engine slug when present (often inside result).",
      +      "type": "string"
      +    },
      +    "ledger_tip": {
      +      "description": "Ask/refuse ledger tip when the door stamped one."
      +    },
      +    "limitations": {
      +      "description": "Capability limitations or Remain-OFF notes when present."
      +    },
      +    "provenance": {
      +      "description": "Provenance / input packet when the pipeline attached one."
      +    },
      +    "ran_in": {
      +      "description": "Execution locale (for example aziel-runtime) when present.",
      +      "type": "string"
      +    },
      +    "receipt": {
      +      "description": "Optional receipt, ledger tip, or TemporalLock/ForgeReceipts exit when the door stamped one."
      +    },
      +    "refusal": {
      +      "description": "Explicit refuse object, code, or message when the door or engine refused."
      +    },
      +    "result": {
      +      "description": "Machine payload. FragGate-style results commonly include ok, code, slug, op, status, engine_slug, engine_op, engine_digest, ran_in, provenance, refusal, limitations, and ledger_tip."
      +    },
      +    "session_id": {
      +      "description": "Raw session id when session plumbing was used. Hidden unless the user asked for the chain.",
      +      "type": "string"
      +    },
      +    "status": {
      +      "description": "HTTP-like status when present on wrappers (200 ok; 400+ error / refuse).",
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  5. First observedv1.5.0

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate non-readonly, non-destructive, non-idempotent. The description adds rich context: mutates session policy only, sealed/expired session refusals, missing-id failure, no exec or new id minting, confirm/dry_run consent semantics. It goes far beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but well-structured. It front-loads purpose and differentiation, then covers errors, parameters, consent, and returns in a logical order. No filler; every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 8 params, mutation, error codes, and consent flags, the description covers prerequisites, side effects, error conditions, and return type. Output schema exists, but the description still clarifies key behaviors, making it fully sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds meaning: aliases, replacement vs. omit semantics, nested policy acceptance, dry_run behavior, confirm as consent not auth. It clarifies each parameter's role beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a precise verb (attach) and resource (session policy) with explicit scope ('already-open raw session'). It clearly distinguishes itself from siblings by stating 'not open and not exec' and naming alternative tools, so an agent can immediately understand its role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly tells when to use (tighter allow_slugs/allow_ops before exec) and when not to, with direct alternatives: runtime_session_exec, runtime_session_open, and fraggate_call. This removes all ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.