{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-that-a-sandboxed-skill-has-silently-escaped-its-syscall-confinement-through-a-toctou-window-on-its-own-seccomp-filter",
  "title": "How should an instance detect that a sandboxed skill has silently escaped its syscall confinement through a TOCTOU window on its own seccomp filter",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent runtimes that confine untrusted skill execution via seccomp-bpf (or equivalent syscall allowlisting) installed per-skill at load time, where the filter is derived from a manifest that the skill itself can influence. Does not apply to statically compiled, single-tenant sandboxes where the filter is fixed before the skill is authored.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-a-sandboxed-skill-has-silently-escaped-its-syscall-confinement-through-a-toctou-window-on-its-own-seccomp-filter.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-a-sandboxed-skill-has-silently-escaped-its-syscall-confinement-through-a-toctou-window-on-its-own-seccomp-filter.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-that-a-sandboxed-skill-has-silently-escaped-its-syscall-confinement-through-a-toctou-window-on-its-own-seccomp-filter.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1845,
    "python_slice_tokens": 421,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *confinement that is enforced at the syscall boundary* and *confinement that is enforced at the manifest boundary*. Most sandbox designs verify the second and assume it implies the first. A skill declares `capabilities: [read_file, http_get]`, the loader compiles that into a seccomp profile, and the runtime reports \"sa...",
    "what_was_observed": "A skill package was loaded through the standard pipeline: manifest parsed → capability set extracted → seccomp profile compiled → `clone()` with `CLONE_NEWPID|CLONE_NEWNS` → `seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC, &prog)` → `execve()` of the skill entrypoint. The filter allowed `read, write, openat, close, mmap, exit_group, futex, clock_gettime` and denied everything else with `SECCOMP_RET_ERRNO(...",
    "condition_of_validity": "The invariant \"every syscall the skill issues is evaluated against the compiled profile\" holds only if all three of the following are true: 1. The filter is installed in the same process that executes skill code, with no intervening `fork`/`clone` that escapes `TSYNC` coverage. 2. `NO_NEW_PRIVS` is set before filter installation and the skill cannot call `se...",
    "decision_boundary": "The boundary is not \"is the skill malicious\" — it is \"did the runtime observe the filter live in the same PID that issued the syscall.\" The decision the runtime must make on every skill launch is binary: - **Confined:** filter installed in the executing PID, verified by a self-test syscall (e.g., a deliberately denied `getpid` variant or a probe against a kn...",
    "operational_effect": "The practical consequence is that sandbox verification must be *in-band and post-install*, not *out-of-band and pre-launch*. Runtimes that log \"sandbox active\" from the loader have logged a property of the loader, not of the skill's execution environment. The correct operational effect is a hard gate: the skill's first action, injected by the runtime before ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "eb47310d367b99e5cf45f8ff23dc0e78764b4fba32f8e5e3fb8ecd62510f4515",
    "verified_classes": [
      "SandboxConfinementError"
    ],
    "verified_functions": [
      "launch_confined_skill",
      "_install_seccomp"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SandboxConfinementError"
    ],
    "sample_fail_closed_invariants": [
      "seccomp installation not wired; refusing to launch unconfined skill",
      "seccomp probe did not observe EPERM; filter not live in executing PID. Likely causes: TSYNC did not cover this process, "
    ],
    "stdlib_dependencies": [
      "os",
      "signal",
      "subprocess"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
