tinyhumansai/openhuman · error · io::Error

jail {id} dir {} is outside registry base {}

Error message

jail {id} dir {} is outside registry base {}

What it means

The registry refused to spawn a process into a jail whose canonicalized directory is outside the registry base. Same guard family as the delete refusal: the sandbox's containment guarantee depends on jail dirs living under the managed base, so a record pointing elsewhere (tampered index, relocated base) fails closed — spawn is denied rather than running outside containment.

Source

Thrown at src/openhuman/sandbox/cwd_jail/registry.rs:366

        let record = self
            .get(id)
            .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, format!("no jail {id}")))?;

        let resolved = record
            .dir
            .canonicalize()
            .unwrap_or_else(|_| record.dir.clone());
        let resolved_base = self
            .base
            .canonicalize()
            .unwrap_or_else(|_| self.base.clone());
        if !resolved.starts_with(&resolved_base) {
            log::warn!(
                "[cwd_jail] refusing spawn: jail {id} dir {} not under base {}",
                resolved.display(),
                resolved_base.display()
            );
            return Err(io::Error::new(
                io::ErrorKind::PermissionDenied,
                format!(
                    "jail {id} dir {} is outside registry base {}",
                    resolved.display(),
                    resolved_base.display()
                ),
            ));
        }

        let mut jail = Jail::new(&record.dir, &record.label);
        jail.canonicalize()?;
        Ok(jail)
    }

    /// Atomic-rename write of the index. Falls back to direct write on
    /// Windows if rename-over fails (Windows traditionally refused
    /// rename-over-existing, though modern NTFS/Win10 supports it).
    fn persist(&self, idx: &Index) -> io::Result<()> {

View on GitHub (pinned to 7491200858)

Solutions

  1. Compare the jail record's dir with the registry base (canonicalize both) to find the divergence
  2. Repair the registry index entry so the jail dir is under base, or recreate the jail
  3. If the base directory moved (e.g. workspace migration), re-register jails under the new base
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/sandbox/cwd_jail/registry.rs:366 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/33868e33677e731d. Report an issue: GitHub.