Skip to content

Security: Sora1916/vibey

Security

SECURITY.md

Security Policy

Overview

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).


Threat Model & Security Boundaries

1. Worktree & Container Isolation Runtime (ADR-0008, Task 9.1)

  • 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: ContainerConfig and OciContainerExecutor (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.py does not import vibey.infrastructure.container, and no CLI flag or vibey.toml key ([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: /tmp is 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=none unless explicitly configured for network-dependent build phases.

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's az invocations, etc.) invoke check_command before 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 DATABASE or DROP TABLE outside migration harnesses.

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.md work item paths would be blocked with a ScopeViolation before staging, once wired in.

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.py hands a GitHub issue to vibey new --intake only after scripts/intake_trust.py has 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 by PromptShield before it enters the ledger, where vibey new records it as an untrusted TranscriptRecorded event (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's VibeySkillsContextCompiler retrieves markdown from the separately versioned vibey-skills marketplace (a workspace member at src/vibey_tools/skills, invoked as a subprocess), whose skill files are themselves third-party content, and build_implement_handler.py appends it verbatim to the BUILD prompt whenever a project's skills_context.mode is inject — with no PromptShield framing. Do not rely on the controls below anywhere but the triaged-delivery intake: seed prompts, interview answers, issue text given to vibey new --intake by 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).

5. Secret Redaction & Environment Hygiene

  • What a model-driven process may see — implemented, tested, and active. Engine sessions (every engine, every phase, and the --version/doctor/--help probes) and gate commands never inherit the worker's environment. Each starts from an allow-list built by ChildEnvironment (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) and XDG_*_HOME/XDG_RUNTIME_DIR.
    • An engine session adds the variables its descriptor declares (env_passthrough: its runner's and vendor CLI's own, for example CLAUDELOOP_*, 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, or engines.<engine> for one engine) or the VibeyProject spec's engineEnvironment, 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's PG*; for gates also GIT_*; for engines also any name containing DSN, DATABASE_URL, PASSWORD or PASSWD. A declaration that tries is refused by vibey new and 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.
  • 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 trust or peer authentication 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, requires scram-sha-256 for every connection, local and remote alike. The required pg_hba.conf lines are in §7. vibey doctor checks for this: its db-passwordless line fails, and vibey doctor exits 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>/environ on Linux), any file the worker can read (a ~/.pgpass, a shell profile that exports VIBEY_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 NOTHING rules on the event parent table, which the role that owns the table can bypass — see the data model.
  • (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's git worktree add, the integration git merge, prune, config and listing calls):

    • with the system basics only, plus GIT_CONFIG_NOSYSTEM=1: no VIBEY_*, no PG*, no credential, and no GIT_* inherited from a surrounding hook;
    • with no hook: -c core.hooksPath=/dev/null outranks every config file, so a hook planted in the common hooks/ directory or behind any core.hooksPath does 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 RepositoryConfigGuard reads the config git will use and fails the job when the local or worktree scope (or a file they include) declares filter.<x>.clean|smudge|process or merge.<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 HEAD in BUILD verify runs through the gate runner with the gate environment and honours the repository's config like any gate command. The scratch repository vibey doctor --conformance creates is driven by the application layer with the doctor's environment. The az CLI runs through its own executor with the system basics plus the Azure CLI's configuration variables; the desktop notifier runs osascript/notify-send with the system basics and passes the notification's text as arguments, never as script.

  • All ledger and telemetry records run through redaction masks (redact.py) to prevent leakage of credentials, tokens, or private keys.

6. Webhook Payload Integrity — implemented, unit-tested, and active when configured

  • infrastructure/notify/ implements a NotificationService whose 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, and vibey new copies [notifications] from the repository's vibey.toml into the project record. Delivery remains opt-in: configure [notifications] enabled = true before relying on desktop or webhook alerts. See the README's Notifications section.

7. The ledger is append-only by the database (ADR-0055) — implemented, tested, and active

  • Triggers refuse every rewrite. Migration 0016 puts a BEFORE UPDATE OR DELETE row trigger and a BEFORE TRUNCATE trigger on event. They cover every partition: the row trigger is cloned onto each, and ledger_guard_partitions() attaches the TRUNCATE guard on every migration run. They refuse the owner's DML too, with the ledger is append-only. Both functions pin search_path = pg_catalog, pg_temp (migration 0017).

  • The triggers do not refuse the owner's DDL. The owner can still DROP a partition, DETACH one and then DELETE from it (a detached table has no clone of the row trigger), TRUNCATE a partition created since the last vibey migrate (it gets the TRUNCATE guard at the next one), or disable a trigger. What stands against those is that nothing but vibey migrate holds 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_URL as an application role that owns nothing. On event it holds SELECT and INSERT only. It holds no DELETE or TRUNCATE anywhere, and it cannot disable a trigger. It may not CREATE in public or in the database, owns no object, and may call no SECURITY DEFINER function that runs as the owner or a superuser: ledger-guard fails on each (review of #1100 — a role that could create in public planted 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 by vibey migrate alone: never export it. In the Helm chart it is mounted only into the migrate init 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 in APP_ROLE_GRANTS and reconciled on every migration run, under the migration lock, with the owner's session pinned to search_path = pg_catalog, pg_temp.

  • An install still on one role is reported, never silently accepted. vibey doctor and vibey doctor --cluster fail ledger-guard, vibey migrate exits 1, and vibey worker says 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 md5 rule asks for a password but accepts a replayable hash, and a password rule 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 uses trust, peer, ident, md5 or password, and passwords are stored as SCRAM verifiers (password_encryption = scram-sha-256). A server that vibey uses must carry these pg_hba.conf lines above any broader rule, and no rule that admits anyone another way. The two 0.0.0.0/0 and ::/0 lines 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-256
    

    In postgresql.conf, set password_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 run SELECT pg_reload_conf();. A password set while the server stored md5 must be set again. The Helm chart's built-in PostgreSQL declares exactly these rules in its own pg_hba.conf and sets password_encryption. CI's PostgreSQL services declare POSTGRES_HOST_AUTH_METHOD and POSTGRES_INITDB_ARGS as scram-sha-256. vibey install --postgres and vibey doctor --install-postgres install the distribution's package, and the package's own pg_hba.conf is left for the operator to replace. The install says so, and vibey doctor fails until it is replaced.

  • vibey doctor checks the server as local-auth:

    • It fails when a password-less connection as the owner or a superuser is let in.
    • It fails when pg_hba.conf has a trust, peer, ident, md5 or password rule that can match them.
    • It fails when password_encryption is anything but scram-sha-256.
    • It reports UNKNOWN, never a pass, when it could neither get in nor read pg_hba_file_rules.

    vibey does not edit a server's pg_hba.conf that it did not deploy. local-auth keeps 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. expires is at most [advisories] max_exception_days (30) after added. 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_allow only, 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/vibey alone, holding only Administration: Read and write (to mint registration tokens and reap offline runners), stored by a file-based gh login 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 own gh directory.

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.


Reporting a Vulnerability

If you discover a security vulnerability in Vibey, please report it responsibly:

  1. Do NOT open a public issue.
  2. Email the maintainer privately at adam@matthewsteinberger.com with the subject [vibey security] (the same published contact as the Code of Conduct).
  3. Include reproducible steps, affected versions, and potential impact.
  4. We will acknowledge receipt within 48 hours and coordinate remediation before public disclosure.

There aren't any published security advisories