Vibey is a queue-based conductor for autonomous software delivery. Because Vibey orchestrates autonomous engines, tools, code mutation, and optional deployment pipelines, isolation and defense-in-depth are foundational architectural requirements (see ADR-0008, ADR-0012, ADR-0013, ADR-0014).
- Worktree Sandboxing: Every job and phase executes inside an isolated ephemeral git worktree branched from base or integration heads. This is the only isolation boundary active today, and it is a boundary for git history, not for the operating system: every engine session, gate command and hook runs as the worker's OS user, with that user's files, sockets and processes within reach (see §5).
- OCI Container Hardening — implemented and unit-tested, not yet an active runtime path:
ContainerConfigandOciContainerExecutor(src/vibey/infrastructure/container/config.py,runtime.py) implement the hardening described below, but nothing outside their own test file (tests/infrastructure/container/test_runtime.py) ever constructs them —bootstrap.pydoes not importvibey.infrastructure.container, and no CLI flag orvibey.tomlkey ([isolation] level = "container"included; see the configuration reference) reaches this code. Every job runs in a plain worktree regardless of what[isolation]says. Do not rely on the controls below until this adapter is wired into the composition root. In particular, §5's same-user exposure is not addressed by anything here today: an unwired container runs nothing, so a model-driven process shares the worker's OS user in every deployment that exists. What the adapter would provide, once wired:- Read-Only Root Filesystem: Containers run with
--read-only. - Dropped Capabilities: All Linux kernel capabilities are dropped (
--cap-drop=ALL). - Privilege Escalation Prevention: Containers run with
--security-opt=no-new-privileges:true. - Ephemeral Storage:
/tmpis mounted as a restricted tmpfs (rw,noexec,nosuid,size=512m). - Resource Capping: Hard memory limits (
--memory=4g) and CPU quotas (--cpus=2.0). - Network Isolation: Defaults to
--network=noneunless explicitly configured for network-dependent build phases.
- Read-Only Root Filesystem: Containers run with
2. Destructive-Command Prevention (Task 9.2) — implemented and unit-tested, not yet an active runtime path
CommandSecurityPolicy(src/vibey/domain/command_guard.py) implements the scans described below, but nothing outside its own test file (tests/domain/test_command_guard.py) ever constructs or calls it — none of the actual subprocess call sites (infrastructure/engines/claudeloop_process.py,infrastructure/build/gate_runner.py, the CLI'sazinvocations, etc.) invokecheck_commandbefore running a command. Do not rely on the controls below: autonomous engines are not currently prevented from executing destructive operations.- Git Safety: Blocks
git reset --hard,git push --force,git push -f,git branch -D main|master. - Filesystem Safety: Blocks
rm -rf /,rm -rf ~,rm -rf *,mkfs.*,dd of=/dev/. - System Safety: Blocks
reboot,shutdown,poweroff, fork bombs. - Database Safety: Blocks raw
DROP DATABASEorDROP TABLEoutside migration harnesses.
- Git Safety: Blocks
3. Scope-Bound Mutation Enforcement (Task 9.3) — implemented and unit-tested, not yet an active runtime path
MutationScope(src/vibey/domain/scope_guard.py) implements the checks described below, but nothing outside its own test file (tests/domain/test_scope_guard.py) ever constructs or calls it — the Phase ② (Build Implement) file-mutation path (application/build_implement_handler.py) never invokes it. Do not rely on the controls below: file mutations are not currently scope-checked.- Directory traversal (
../, absolute paths escaping the worktree root) - Symlink escapes pointing outside the repository tree
- Modification of sensitive repository assets (
.git/,.env*,id_rsa,secrets.json) - Modification of files outside declared
spec.mdwork item paths would be blocked with aScopeViolationbefore staging, once wired in.
- Directory traversal (
4. Untrusted Prompt Defense & Delimiter Shielding (Task 9.4) — implemented and unit-tested; active on one path, the triaged-delivery intake
- Active on the triaged-delivery intake.
scripts/triaged_delivery.pyhands a GitHub issue tovibey new --intakeonly afterscripts/intake_trust.pyhas checked, from one forge query and against the trust grant in reviewed history, that the issue's author, every editor and whoever applied its triage labels are trusted (the storm's own seam,storm_trust.py; ADR-0053, sub-doctrine 12.j). An issue a stranger wrote, edited or labelled is held for a person and never dispatched. An admitted issue is framed byPromptShieldbefore it enters the ledger, wherevibey newrecords it as anuntrustedTranscriptRecordedevent (docs/runbooks/triaged-delivery.md). The trust check is the control that holds: measured on gpt-oss:20b, the frame did not reduce how often a planted instruction surfaced in the DESIGN interview's questions (4 of 10 runs raw, 5 of 10 framed). - Nowhere else. Outside that one path, nothing constructs or calls
PromptShield— no design or build handler (application/seed_prompt.py,application/design_handler.py,application/build_implement_handler.py, etc.) frames untrusted input through it. This includes the skills-context packet:infrastructure/skills_context.py'sVibeySkillsContextCompilerretrieves markdown from the separately versionedvibey-skillsmarketplace (a workspace member atsrc/vibey_tools/skills, invoked as a subprocess), whose skill files are themselves third-party content, andbuild_implement_handler.pyappends it verbatim to the BUILD prompt whenever a project'sskills_context.modeisinject— with noPromptShieldframing. Do not rely on the controls below anywhere but the triaged-delivery intake: seed prompts, interview answers, issue text given tovibey new --intakeby any other caller, skills-context packets, and other third-party inputs are not currently shielded.- Strips non-printable ASCII control codes and ANSI escape sequences.
- Generates unique cryptographic nonces per interaction (
<{label}_{nonce}>...<{label}_{nonce}>). - Neutralizes XML/tag delimiter breakouts (
</...escaping). - Prepends explicit security directives instructing models to treat framed inputs strictly as data.
- Audits for common injection heuristics (
is_suspicious_injection).
-
What a model-driven process may see — implemented, tested, and active. Engine sessions (every engine, every phase, and the
--version/doctor/--helpprobes) and gate commands never inherit the worker's environment. Each starts from an allow-list built byChildEnvironment(src/vibey/infrastructure/process/child_environment.py):- Every child: the system basics only —
PATH(with vibey's own venv removed),HOME,USER,LOGNAME,SHELL, the temp directory, locale (LANG,LANGUAGE,LC_*),TZ, the terminal (TERM,COLORTERM,NO_COLOR,COLUMNS,LINES), the CA bundle (SSL_CERT_FILE,SSL_CERT_DIR,REQUESTS_CA_BUNDLE,CURL_CA_BUNDLE,NODE_EXTRA_CA_CERTS), the proxy (HTTP(S)_PROXY,NO_PROXY,ALL_PROXY, either case) andXDG_*_HOME/XDG_RUNTIME_DIR. - An engine session adds the variables its descriptor declares (
env_passthrough: its runner's and vendor CLI's own, for exampleCLAUDELOOP_*,CLAUDE_CODE_*,ANTHROPIC_*) and its own API credential (auth_env); the full per-engine table is in the configuration reference. - Anything else reaches an engine only when the project declares it, in
vibey.toml's[engine_environment](allow, orengines.<engine>for one engine) or theVibeyProjectspec'sengineEnvironment, and a gate only through[gates]env_allow(spec.gates). A GitHub token or a cloud credential is on no default list: it reaches only the engine it is declared for. - Never, whoever declares it: vibey's own
VIBEY_*variables —VIBEY_PG_URL, the queue and ledger DSN, among them — and libpq'sPG*; for gates alsoGIT_*; for engines also any name containingDSN,DATABASE_URL,PASSWORDorPASSWD. A declaration that tries is refused byvibey newand the operator before the project exists, and when the worker is built; an engine descriptor's own passthrough is checked when its adapter is built.
- Every child: the system basics only —
-
The limits of this control — read these before relying on it. It keeps the DSN out of a child's environment. It is not a boundary between the worker and the processes it starts, because they are the same OS user:
- (a) A local PostgreSQL with
trustorpeerauthentication needs no DSN at all. Any process running as the OS user the database trusts connects with no password:psql -d vibey, as that user, over the local socket or localhost. Review did exactly that on a development machine, connecting as the operator's own user with no password. An engine session or a gate command is such a process, so on that machine the allow-list does not stop it reaching the queue and the ledger. Such a server does not conform to this project: sub-doctrine 10.j, drafted in ADR-0061 and in force once the operator's merge ratifies it, requiresscram-sha-256for every connection, local and remote alike. The requiredpg_hba.conflines are in §7.vibey doctorchecks for this: itsdb-passwordlessline fails, andvibey doctorexits 1, when the app DSN's database accepts a password-less login as the DSN's role or as the worker's OS user, on the DSN's host or (when that host is local) a local socket. Running the worker as an OS user nothing else runs as narrows who can reach the socket, but it does not replace the requirement. - Same-user reach beyond the database. A process running as the worker's user can read
the worker's own environment through the OS (
/proc/<pid>/environon Linux), any file the worker can read (a~/.pgpass, a shell profile that exportsVIBEY_PG_URL, a launchd plist), and can write the user's global git config and home directory. - (b) The container boundary in §1 does not address any of this today. It is implemented but not wired in; nothing runs in a container, so nothing is isolated from the worker's user. Until it is wired (and runs sessions as a different user or with no access to the database's socket), same-user access is open.
- The ledger's append-only rule is enforced in the database by
DO INSTEAD NOTHINGrules on theeventparent table, which the role that owns the table can bypass — see the data model.
- (a) A local PostgreSQL with
-
(c) vibey's own git calls — what is and is not covered. vibey runs git on repositories an engine writes to from its linked worktree, so a planted hook or config entry would otherwise run inside vibey's git calls.
CleanGitEnvSubprocessExecutor(src/vibey/infrastructure/git/clean_env.py) runs every one of them (the BUILD worktree'sgit worktree add, the integrationgit merge, prune, config and listing calls):- with the system basics only, plus
GIT_CONFIG_NOSYSTEM=1: noVIBEY_*, noPG*, no credential, and noGIT_*inherited from a surrounding hook; - with no hook:
-c core.hooksPath=/dev/nulloutranks every config file, so a hook planted in the commonhooks/directory or behind anycore.hooksPathdoes not run; the integration merge also passes--no-verify(switching off repository-planted hooks in vibey's own merge plumbing — vibey's gates run separately, before integration, and are not skipped); - with no file-system monitor:
-c core.fsmonitor=false; - and it refuses a repository whose own config declares a filter or merge driver.
Drivers are named by the repository and cannot be switched off generically, so before a
checkout or a merge
RepositoryConfigGuardreads the config git will use and fails the job when thelocalorworktreescope (or a file they include) declaresfilter.<x>.clean|smudge|processormerge.<x>.driver.
Not covered: a filter or merge driver in the operator's global git config (Git LFS installs one there) still runs — without vibey's secrets in its environment, but as the operator, and an engine running as the same user can write that file.
git diff HEADin BUILD verify runs through the gate runner with the gate environment and honours the repository's config like any gate command. The scratch repositoryvibey doctor --conformancecreates is driven by the application layer with the doctor's environment. TheazCLI runs through its own executor with the system basics plus the Azure CLI's configuration variables; the desktop notifier runsosascript/notify-sendwith the system basics and passes the notification's text as arguments, never as script. - with the system basics only, plus
-
All ledger and telemetry records run through redaction masks (
redact.py) to prevent leakage of credentials, tokens, or private keys.
infrastructure/notify/implements aNotificationServicewhose webhook dispatch signs payloads with HMAC-SHA256 signatures (X-Vibey-Signature: sha256=...) and validates them against URL scheme restrictions, and it is covered by tests.build_app()constructs the service, andvibey newcopies[notifications]from the repository'svibey.tomlinto the project record. Delivery remains opt-in: configure[notifications] enabled = truebefore relying on desktop or webhook alerts. See the README's Notifications section.
-
Triggers refuse every rewrite. Migration 0016 puts a
BEFORE UPDATE OR DELETErow trigger and aBEFORE TRUNCATEtrigger onevent. They cover every partition: the row trigger is cloned onto each, andledger_guard_partitions()attaches theTRUNCATEguard on every migration run. They refuse the owner's DML too, withthe ledger is append-only. Both functions pinsearch_path = pg_catalog, pg_temp(migration 0017). -
The triggers do not refuse the owner's DDL. The owner can still
DROPa partition,DETACHone and thenDELETEfrom it (a detached table has no clone of the row trigger),TRUNCATEa partition created since the lastvibey migrate(it gets theTRUNCATEguard at the next one), or disable a trigger. What stands against those is that nothing butvibey migrateholds the owner's DSN. DDL-refusing event triggers (ddl_command_start,sql_drop) are future work: they need a superuser to install. -
The application cannot rewrite the ledger. Every workload connects with
VIBEY_PG_URLas an application role that owns nothing. Oneventit holdsSELECTandINSERTonly. It holds noDELETEorTRUNCATEanywhere, and it cannot disable a trigger. It may notCREATEinpublicor in the database, owns no object, and may call noSECURITY DEFINERfunction that runs as the owner or a superuser:ledger-guardfails on each (review of #1100 — a role that could create inpublicplanted an operator the owner's SQL resolved to, and wiped the ledger). Migrations and grants run with the owner's DSN,VIBEY_PG_MIGRATE_URL, read byvibey migratealone: never export it. In the Helm chart it is mounted only into themigrateinit container; each surface database (Plane, Infisical) is owned by a login role of its own, so no surface pod holds the owner's credentials. The grants are declared inAPP_ROLE_GRANTSand reconciled on every migration run, under the migration lock, with the owner's session pinned tosearch_path = pg_catalog, pg_temp. -
An install still on one role is reported, never silently accepted.
vibey doctorandvibey doctor --clusterfailledger-guard,vibey migrateexits 1, andvibey workersays so on stderr at every start. The upgrade path is in the configuration reference. -
The split protects the ledger only once every connection proves its password with scram-sha-256. A server that trusts its socket (the common default for a local PostgreSQL) lets any process running as the right OS user connect as a superuser without a DSN or a password, and no grant stops that. An
md5rule asks for a password but accepts a replayable hash, and apasswordrule sends it in clear. -
scram-sha-256 is the required configuration, not an option (sub-doctrine 10.j, ADR-0061; law once the operator's merge ratifies it). Every PostgreSQL connection this project configures, documents or installs authenticates with
scram-sha-256, local and remote alike. It never usestrust,peer,ident,md5orpassword, and passwords are stored as SCRAM verifiers (password_encryption = scram-sha-256). A server that vibey uses must carry thesepg_hba.conflines above any broader rule, and no rule that admits anyone another way. The two0.0.0.0/0and::/0lines are for a server that takes remote connections. A server that listens only locally needs only the first three.# TYPE DATABASE USER ADDRESS METHOD local all all scram-sha-256 host all all 127.0.0.1/32 scram-sha-256 host all all ::1/128 scram-sha-256 host all all 0.0.0.0/0 scram-sha-256 host all all ::/0 scram-sha-256In
postgresql.conf, setpassword_encryption = scram-sha-256(the default since PostgreSQL 14). Give every role that logs in a password before reloading (ALTER ROLE … PASSWORD …, which stores a SCRAM verifier under that setting), or it can no longer connect. Then runSELECT pg_reload_conf();. A password set while the server storedmd5must be set again. The Helm chart's built-in PostgreSQL declares exactly these rules in its ownpg_hba.confand setspassword_encryption. CI's PostgreSQL services declarePOSTGRES_HOST_AUTH_METHODandPOSTGRES_INITDB_ARGSasscram-sha-256.vibey install --postgresandvibey doctor --install-postgresinstall the distribution's package, and the package's ownpg_hba.confis left for the operator to replace. The install says so, andvibey doctorfails until it is replaced. -
vibey doctorchecks the server aslocal-auth:- It fails when a password-less connection as the owner or a superuser is let in.
- It fails when
pg_hba.confhas atrust,peer,ident,md5orpasswordrule that can match them. - It fails when
password_encryptionis anything butscram-sha-256. - It reports
UNKNOWN, never a pass, when it could neither get in nor readpg_hba_file_rules.
vibey does not edit a server's
pg_hba.confthat it did not deploy.local-authkeeps failing while any such rule can match the owner or a superuser. No exemption is kept for administration: an administrator authenticates with scram-sha-256 like everyone else.
8. Dependency advisories — every known one blocks, unless an expiring exception is declared and reviewed
Python dependencies are gated by pip-audit in CI's gates job. The npm lockfiles, the root
workspace and clients/app, are gated by vibey-gh advisory-check in the @vibey/core, app and
vscode-extension jobs. The check runs npm audit --json and fails on every advisory at
[advisories] audit_level (high) or worse, as npm audit --audit-level=high does. The one
difference is that an advisory may be excepted in .github/advisory-exceptions.toml.
If the advisory service itself cannot be reached, no audit happened, and the gate fails by
default (on_unavailable = "fail"). This repository sets on_unavailable = "warn": an npm
network timeout or 5xx is reported as a ::warning:: naming the workspace and the reason and
the job continues, with the workspace explicitly unaudited. It does not excuse an advisory,
a malformed report, a missing lockfile, or an advisory-database lookup that failed.
An exception exists for an advisory that cannot be fixed yet, such as one with no patched release, where the vulnerable code is shown not to be reached. It is not a way to skip the gate:
- Declared narrowly. Each entry names one GitHub advisory (
GHSA-…), one package and one workspace. It says why the vulnerable code is not reached, with the evidence (dependency path, call sites, shipped bundles). It also gives the condition that retires it and where upstream tracks that condition. - Expiring.
expiresis at most[advisories] max_exception_days(30) afteradded. On that date the exception stops being honoured and CI fails until someone takes the fix or re-decides it with fresh evidence.warn_days(7) before then, every run warns. - Never silent. Every run prints each exception it honours, the date it runs until, and the packages that are flagged only because of it.
- Self-retiring. The check fails when an exception matches nothing at the audit level any more, so it is deleted rather than left to rot. It also fails when the advisory database names a patched release of the package, so the fix replaces the exception. When the database cannot be read, the exception is not honoured. The same applies when npm reports an error or returns a report the check cannot account for: it is refused, not passed.
- Reviewed. The file is a protected path (
.github/CODEOWNERS,[merge_train] protected_paths). Accepting a risk takes the code owner's approval and a human merge, and the merge train never lands a change to it unattended. Merging an exception accepts its risk until it expires.
9. The sovereign review runner reads untrusted pull-request content on the operator's machine — accepted 2026-10-24
The sovereign review lane (sub-doctrine 8.a) runs pr-review.yml's host job on a self-hosted
runner, labelled vibey-local-vibey, on the operator's own Mac. A pull request's diff, title
and description are untrusted text, and a model and its tools read them there. The operator
accepted that risk on 2026-10-24 (#668, item 10), on these conditions, which are the
isolation in force and are set out, with a way to verify each, in
docs/runbooks/sovereign-review-runner.md:
- One ephemeral container per job. The supervisor starts a fresh runner container for each job, so one job's container is not another's.
- An egress gate. The job container joins only an internal Docker network, so the gate
(
vibey-egress) is the only thing it can reach: HTTPS on port 443 to the hosts in[runners] egress_allowonly, refusing any address that is not globally routable, and the model server's four read and chat endpoints. A job cannot pull, create or delete a model, and cannot reach any other service on the machine. This closes a hole measured on 2026-10-09, when the host's PostgreSQL and RabbitMQ ports accepted connections from inside a runner container. - A credential of its own, scoped to one repository. The runner logs in with a
fine-grained token for
the-vibey-project/vibeyalone, holding only Administration: Read and write (to mint registration tokens and reap offline runners), stored by a file-basedghlogin in~/.config/gh-runner. It is never the operator's own login, which can administer every repository the operator owns. The supervisor refuses to start if that login is missing, if its credential file is readable by other users, if GitHub rejects the token, or if the directory resolves to the operator's ownghdirectory.
What this does not remove. The gate bounds what a job can reach, not what it can compute: a hostile pull request can still try to steer the model that reads it, and the token the supervisor holds can still register and delete this repository's runners. The accepted risk is exactly those two. Reopen it if a job is found reaching anything outside the gate, if a container escape is demonstrated, or if the token's scope is widened.
If you discover a security vulnerability in Vibey, please report it responsibly:
- Do NOT open a public issue.
- Email the maintainer privately at adam@matthewsteinberger.com with the subject
[vibey security](the same published contact as the Code of Conduct). - Include reproducible steps, affected versions, and potential impact.
- We will acknowledge receipt within 48 hours and coordinate remediation before public disclosure.