Skip to content

Security: dan-petty/devops-cli

SECURITY.md

Security Policy — DevOps CLI

DevOps CLI follows an enterprise zero-trust security model designed to safeguard developer workstations, local and remote Kubernetes clusters, CI/CD pipelines, and agentic AI execution environments.


Supported Versions

Only the latest release gets security fixes. A fix ships in the next release.


Zero-Trust Security & Egress Safety Principles

All code authored in or evaluated by DevOps CLI must strictly adhere to the following security guarantees:

  1. Zero Secret Leakage: Plaintext secrets, tokens, private keys, or API credentials must never be committed to code repositories, written to unencrypted configuration files, or emitted into terminal outputs/logs. Each secret comes from a secret store: the OS keyring, HashiCorp Vault, a Kubernetes Secret or the credential store of the tool that owns it. In the cluster, devops k8s push-secrets writes each platform Secret from the keyring, and the External Secrets Operator makes each service Secret from an ExternalSecret (ADR 0033). A service repository holds no Secret object and no value. Never copy the content of a gitignored file (.env*, .ssh/, .data/, credentials, private keys) into a document, changelog, finding, commit or code. A pod that loads Secret devops/devops-cli with envFrom and sets no Qdrant key of its own, such as a Job of CronJob devops-cli or the MCP server, holds the read-only key of llm/qdrant-api-key, never its admin key. The runner pod and the roadmap Service hold no Qdrant key (#6518). WorkflowTemplate rag-ingest writes to Qdrant, so it sets the admin key.

  2. Strict Egress & SSRF Protection: All outbound HTTP requests are built by devops_cli.http.entry and checked at the connect by the egress transport of devops_cli.http.client against their egress level (public, loopback or private) to prevent Server-Side Request Forgery (SSRF). Kept pre-flight checks (Qdrant, kubectl manifest apply, container engine endpoint, config init wizard) call vet_addresses directly at their level. Cloud metadata addresses are refused at every level. The in-process kubernetes client (urllib3) is trusted because its address comes from the operator's kubeconfig or the in-cluster environment.

  3. Subprocess Bounded Execution: All external commands (git, helm, kubectl, tofu, docker, ansible-runner) are executed via bounded argument lists (preventing shell injection) with mandatory non-infinite timeouts.

  4. Data Isolation: Agent-generated review logs, benchmarks, and temporary telemetry artifacts are isolated under dedicated agent subfolders (<data_dir>/agent, e.g. ./.data/agent), completely segregated from the primary user workspace data tier (DEVOPS_CLI_DATA_DIR / data.dir).

  5. Least Privilege Runtime: Kubernetes pods, Docker containers, and CI jobs run under unprivileged, non-root user contexts (USER 1000:1000).

  6. Host Sandbox Confinement: Executable verification criteria and model-generated shell commands are confined within Linux unprivileged namespaces via bubblewrap (bwrap), enforcing unshared namespaces, cleared environment, read-only repository and system mounts, zero network egress, and isolated POSIX process groups. The host sandbox's /tmp is a private 64 MiB tmpfs mounted nosuid and nodev, which the confined command can write to and execute from, because bubblewrap has no noexec option for a tmpfs.

  7. Review Tool Execution: A review starts its tools through a ToolExecutor (src/devops_cli/security/tool_executor.py). The tools are Bandit, Gitleaks, Semgrep, Trivy, kube-linter, Pluto, osv-scanner, golangci-lint, Ruff, mypy and the canary of each. The record of each run names the executor in force. It is the executor field in tool_runs of profile.json, and the Executor column of the Tool Runs table in review.md. The record also names the network of the tool in the network field: host for the direct executor, none for the sandbox, and kube-api for the sandbox with that network profile. Two executors exist:

    • sandbox is SandboxToolExecutor, and it is the default of devops review path, branch and pr and of their MCP tools. It runs the tool in a bubblewrap sandbox with no network, a cleared environment, a read-only tree and a private HOME. The sandbox shows the system directories, the tree and only what the request names: the program of the tool (its virtualenv, with the Python installation that the virtualenv links to, behind the guard of HostSandbox), its config and ruleset files, the data that a fetch step got before (the Trivy cache and the osv-scanner database, read-only; devops review fetch-databases is that step, and a scan that lacks a database, or finds the osv-scanner database older than 24 hours, gives a coverage gap that names it) and the host paths in CONST_TOOL_HOST_READ_ONLY_PATHS (the CA certificates for Semgrep). golangci-lint also gets the Go toolchain and the module cache that go env names on the host, read-only, with the bin of the toolchain first on its PATH. Its go command fetches no module and no toolchain (GOPROXY=off, GOTOOLCHAIN=local), so a module whose modules are not in the module cache gives a coverage gap that tells the person to run go mod download. A directory that the tool writes, the cache of mypy or of Ruff, or the Go build cache and the golangci-lint cache, for the tree, is bound read-write. The sandbox refuses a bind that holds the home directory or the tree, or passes through a credential directory. Each process of the tool has the CPU limit CONST_TOOL_CPU_LIMIT_SECONDS and the address-space limit CONST_TOOL_MIN_ADDRESS_SPACE_BYTES. Gitleaks and Semgrep get the larger value that CONST_TOOL_ADDRESS_SPACE_BYTES names, and Semgrep runs CONST_SEMGREP_JOBS jobs. A Go tool gets GOMEMLIMIT set to CONST_TOOL_GO_MEMORY_LIMIT. The wall-clock limit applies as well. The sandbox sets no limit on the number of processes, because RLIMIT_NPROC counts every process of the user and would starve the host.
    • direct is DirectToolExecutor. It starts the tool as a child process of devops-cli. It has no confinement: the tool has the network, the environment and the files of the user. It has no limit except the wall-clock time of the scan, DEFAULT_SECURITY_SCANNER_TIMEOUT_SECONDS. A review uses it only in the pod of a runner Job, where the seccomp profile refuses the user namespace that the sandbox needs and the pod is the isolation boundary (ADR 0031, #3827). There a scanner that the image lacks fails the review (ReviewScannerMissingError). Everywhere else no option, config key or MCP tool turns the sandbox off (decision 1 of #772). The scans of devops scan and of the agent tools are not reviews, and each scanner except Popeye uses this executor there.
    • The sandbox has one network profile, kube-api, and only Popeye can select it (decision 2 of #772). devops k8s audit, the agent tool scan_popeye and the scanner registry run Popeye in the sandbox with this profile, from an empty directory. The sandbox keeps no network of its own (--unshare-all). Outside the sandbox, kubectl proxy listens on a Unix socket in a scratch directory for one context. It reads the kubeconfig and the credentials of the user, and refuses the methods POST, PUT, PATCH and DELETE (CONST_KUBE_API_REJECTED_METHODS) and the exec, attach, port-forward and proxy paths (CONST_KUBE_API_REJECTED_PATHS). setpriv --pdeathsig KILL ends the proxy with the run. In the sandbox, socat relays 127.0.0.1:8001 to the socket, and Popeye reads a kubeconfig that names the relay and holds no credentials. The sandbox binds the scratch directory and /etc/passwd read-only. So Popeye reaches only the API server of the context, only to read, with the RBAC of the user. The limits: the path filter is a deny list, so a new subresource that reaches past the API server passes until CONST_KUBE_API_REJECTED_PATHS lists it, and Popeye reads each response that the user can read, such as a Secret. The direct executor refuses a request that selects the profile. A host without sh, socat, kubectl or setpriv, or one that cannot start the sandbox, runs no Popeye scan: the scan reports a coverage gap with the cause, and devops k8s audit exits 1.

    Before its first tool runs, a review checks that the host can start the sandbox: bubblewrap and prlimit are installed, and bubblewrap can make a sandbox. On Ubuntu 24.04 and later, AppArmor refuses unprivileged user namespaces to a program that has no profile with the userns rule (kernel.apparmor_restrict_unprivileged_userns). A host that fails the check fails closed: no tool runs, in the sandbox or outside it, each scan reports a coverage gap with the cause, and the review says the cause and what a person can change on the host one time. The record is read before the tool starts. Under the direct executor, a tool that fetches its rules during the run, such as Trivy with an old cache, may use newer rules than the record names, and Ruff also applies a config file above the tree and its user config file, which the record does not name.

  8. Repository Hygiene: Never write an internal hostname (*.lan, *.local, a machine name), a private address (RFC 1918), a private registry, a non-standard NodePort, a device or mount path, or the cluster topology into a committed file. Use <storage-node>, <gpu-node>, <worker-node> or <host> for a host, example.com for a domain, RFC 5737 blocks (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) or loopback for an address, ghcr.io/<org>/<image>:<tag> for a registry and <storage-mount-path> for a path. Committed templates (config.example.yaml) use localhost endpoints. The user's config.yaml is not committed: never reset its URLs or ports. tests/invariants/test_committed_addresses.py holds this rule for addresses and .lan hosts. It parses each tracked file with ipaddress and fails on an RFC 1918 host address or a .lan host. A range in CIDR form names no machine, and the upstream defaults and examples that the test names (the minikube node, the AKS DNS service, the OpenTelemetry server.address example) are not ours, so both pass. Test code, which must hold private addresses to test the egress and reference classifiers, the archived OpenSpec changes and CHANGELOG.md, which release-please writes, are outside its scope. The domain row of devops ci (tests/gate/configured_domain.py) holds this rule for the domain of the cluster. It reads k8s.domain and cloudflare.domain from the config at run time, so the value goes into no file. It reads each added line and each path of each commit from origin/main to HEAD, and fails on the domain or a name under it. Each finding names the path, the line, the commit and the settings key, and never the value. The pre-push hook runs the row, so a push of a person, an agent or the runner Job sends no such commit. Where no domain is configured, such as on the GitHub runners, the row is skipped with its cause. Public evidence, such as a pull request comment or an issue, holds exit codes and counts only. It never holds argocd app diff output or Application YAML, because the live objects hold the real hosts.

  9. No Phone-Home: Turn off third-party telemetry, usage reports, crash analytics and update checks in every tool, workload and container when the user loses no function. Examples are DO_NOT_TRACK=1, GOTELEMETRY=off, PIP_DISABLE_PIP_VERSION_CHECK=1, HF_HUB_DISABLE_TELEMETRY=1 and OPENSPEC_TELEMETRY=0. Ask the user before you turn off a feature that shows content, such as update notices or a marketplace.

  10. Bounded Error Detail: Cap each external value in an exception details dictionary or a structured log at 256 characters (CWE-209, CWE-400).

  11. MCP Tool Inputs: A URL or host that a model gives to an MCP tool is untrusted input, not configuration. A tool publishes no option for it, and queries the service that the configuration names. _PATH_PARAM_RESTRICTIONS in src/devops_cli/ai/mcp/generator.py sets the options that a tool publishes. A credential goes only to the origin that the configuration names, whatever the egress level is. _key_for in src/devops_cli/ai/gateway.py applies this rule to the AI API key. A tool that publishes such an option is a defect. A file path that a model gives is untrusted input too: a tool publishes no option for a path that the command writes or reads, unless a path helper confines the path (safe_resolve_subpath in src/devops_cli/core/paths.py).

The --url option of the devops valkey commands is an accepted case. A person types it, and no model gives the URL. So valkey.password goes to the host that the person names. Five of the nine devops valkey commands are MCP tools: valkey_ping, valkey_stats, valkey_info, valkey_get and valkey_flush. valkey set is not an MCP tool (rule 12). These tools publish no URL option. The commands valkey keys, valkey backup and valkey cli are not MCP tools.

The streamable-http transport is a network listener. See MCP Server on the Network.

  1. MCP Tool Secrets: A model writes the arguments of an MCP tool call. A secret in an argument passes through the model context, the provider, the LLM cache and the run trace, and the model can send it to another tool. So a tool publishes no parameter that takes a secret value (a password, a token, an API key or a private key). A credential for a call is carried on the connection, as a header that the harness sets, or the server reads it from its configuration, or it is an opaque reference that the server resolves from the secret store, such as keyring:<name> for the OIDC token of docker_sign. A tool never returns or logs a credential, so vault_get publishes no show option, and vault_set is not a tool. CONST_MCP_SECRET_PARAMETER_WORDS in src/devops_cli/config/constants.py lists the words that make a parameter name suggest a secret. tests/ai/mcp/test_mcp_tool_secrets.py reads the published schema of every tool and fails on a text parameter whose name holds one of them. CONST_MCP_SECRET_PARAMETER_ALLOWLIST names the parameters that hold no secret value, such as the name of a Kubernetes Secret. A new entry needs a reason, and the test fails on an entry that matches no parameter. A name word cannot find a free-text parameter that is copied into an environment, a file or a store, so valkey_set is not a tool and sandbox_deploy publishes no env (the denied key of _PATH_PARAM_RESTRICTIONS in src/devops_cli/ai/mcp/generator.py omits an option). CONST_MCP_FREE_TEXT_SINK_PARAMETER_NAMES lists the names env, values, value and data. CONST_MCP_FREE_TEXT_SINK_ALLOWLIST names each published parameter with such a name that holds no secret, with its reason, and the same test fails on a stale entry. RunTrace hides the value of an argument under such a name, and mask_secrets is the second guard. ArgumentValueLogFilter keeps all arguments out of the FastMCP log.

  2. Hosted Models: The LiteLLM gateway serves five groups that call a provider outside the cluster: gemini-3.8-flash, claude-sonnet-5-5, claude-haiku-5-5, deepseek-v4.1-flash-1017 and deepseek-v4.1-flash (the last two through OpenRouter, which picks a third-party provider and is asked to skip providers that store or train on prompts). A prompt sent to one of them leaves the cluster, and the provider bills each token. So no pool names a hosted group, no fallback sends a group that is not hosted to a hosted group, and a request reaches a provider only when its caller names a hosted group. The Service config names deepseek-v4.1-flash-1017 for ai.model, the task chat and each task of a roadmap job except intake, retitle, refine and alternatives, which name the local qwen3.8:27b (k8s/devops/configmap.example.yaml, owner decisions of 2026-11-07, #3874, 2026-11-10, #4369, 2026-11-15 and 2026-11-16; each job has a task of its own since #5903). So the code of the repositories of the Service, which can be private, leaves the cluster to OpenRouter in the prompts of a step, and so do the titles and bodies of the issues in the prompts of the stage job and chat. A job task, such as stage or refine, names claude-sonnet-5-5 only in a trial: its prompts, which hold the issue and the repository text that the job reads, then leave the cluster to Anthropic. The ladders of the edit and repair steps of the implement job name only DeepSeek, one tier each (owner decision of 2026-11-10, #4371): a Sonnet tier there is a later trial, and its prompts, which hold repository code, would leave the cluster to Anthropic. Project text and project code can go to a hosted provider, Jev included, but a secret or personal data, such as an email address, never goes. The owner holds claude-sonnet-5-5 since 2026-11-11: run no trial, eval or comparison with it until the owner lifts the hold. The embedding slot and the tasks intake, retitle, refine and alternatives stay in the cluster. Two fallbacks link hosted groups. claude-sonnet-5-5 to deepseek-v4.1-flash-1017 (#3152) sends the prompt of a failed Claude call to OpenRouter, not to Anthropic. deepseek-v4.1-flash-1017 to deepseek-v4.1-flash (#5564) sends the prompt of a failed call to the same provider, OpenRouter, with the same filters. The keys are optional keys of the Secret llm/llm-gateway-secrets (keyring: gemini.api_key, anthropic.api_key, openrouter.api_key). The gateway NetworkPolicy admits TCP 443 to public addresses and to no private or metadata range. A Claude group sets its prices, drops the sampling parameters that its API refuses, and sets supports_native_structured_output and supports_response_schema, or a structured call becomes a forced tool call that Sonnet 5.5 refuses (#3140). TypeSafe Jev (typesafe/jev-1.14) is no group: the gateway passes POST /v1/systemone to the System One endpoint of OpenRouter with the OpenRouter key of the gateway, for a caller that holds a valid gateway key (#4289). A prompt sent to it leaves the cluster, and the pass-through cannot set data_collection, so the privacy setting of the OpenRouter account applies.

  3. Roadmap Item Authors: The repository is public, and a roadmap job gives the text of an item to a model. The model writes into the roadmap and, through Ready items, steers the agents that build.

    • The authors. A job takes an item only when its author is a person with write access. For such a person, author_association is OWNER, MEMBER or COLLABORATOR (#2478). A job also takes an item of two bots. Their login is exactly service.github_app.bot_login or github-actions[bot] (#3502).
    • The login. GitHub gives both bots the association CONTRIBUTOR. It gives the same association to any account with a merged commit. So the exact login is the only proof. The check compares the whole login, so a login that only resembles it is not trusted. With no service.github_app.slug set, no item of the App is trusted.
    • Other accounts. A job leaves out any other bot and any outside account. Refine tells the author once with a comment.
    • The review. An item of a bot is text that no person wrote. It reaches Ready only after the review of refine approves the issue and the proposal (refine.judge). The stage, implement and alternatives jobs take it only with that approval. The approval holds only for the body that the review read. A body edit ends it, and a refine round reviews the item again.
    • The controls. The review is a model, and text in an item can mislead it, so it is no security control. The controls are the login, the filter for replies, and the person who merges each pull request. Refine and the alternatives job give their models only the replies of a person with write access and of the App's bot. A comment of a bot starts no implement: retry, because that check keeps the association test.
    • The risk that stays. github-actions[bot] is the identity of every workflow of the repository. A workflow that copies untrusted text into an issue gives that text a path to Ready, behind the review. A record block in that text would forge the approval, because the job record is a hidden block of the issue body. The audit workflow writes a fixed text, and refine neutralizes <! in the text that it files for a Service item (#2478). So neither gives that path today.
    • The tests. tests/roadmap/test_roadmap_trust.py and tests/roadmap/refine/test_roadmap_refine_trust.py fail when any of this breaks.
  4. The GitHub Token of a Child Program: The process runner (src/devops_cli/core/process.py) gives each gh and git child the GitHub token of its session in its environment, as GH_TOKEN, and no other GitHub token. So a caller that shapes the output of a gh child, for example with --jq, which can read $ENV, can read the token of its own session. The filter is the code of the caller, and it holds no more than the caller holds. Only devops-cli code calls gh in a process that holds the App token, and the agent container of a runner Job holds no token (#3700). mask_secrets is a last net, not a boundary: it finds a token by its prefix.

    • gh. A gh child gets the session's token as GH_TOKEN, and no GITHUB_TOKEN. The local gh commands (gh auth, version and help) get the tokens of the environment.
    • git. Each git child gets GH_TOKEN, which gh auth git-credential reads. git finds that helper as it does in a shell: devops-cli adds no -c value. A child of a person gets the GIT_CONFIG_COUNT, GIT_CONFIG_KEY_<n> and GIT_CONFIG_VALUE_<n> of the environment, with which the devcontainer sets the helper. A process that acts as the GitHub App gives these keys to no child: the runner and Service images set the helper in /etc/gitconfig. A caller cannot set them.
    • A timeout. Each child that gets the session's token starts in a session of its own. A timeout kills its whole process group, so no helper that the child started, such as git-remote-https, keeps the token in its environment. After a Ctrl+C, the group first gets SIGINT and 0.25 s, as subprocess.run gives a child, so git removes its lock files before the SIGKILL.
    • The roadmap Jobs. The runner Job runs each phase in its own container (#3700, ADR 0030). Only prepare and publish hold the App key, and neither runs a program of the pull request. agent holds the model key and no GitHub credential, mounts no state folder, and makes no GitHub call. So the agent and the code of the checkout that it runs (the tests, the hooks of pre-commit and the exit checks) find no GitHub token. prepare clones into a new folder before the agent phase starts. publish applies the patches of the agent as data in a new repository and pushes from there, with GIT_CONFIG_GLOBAL=/dev/null, GIT_CONFIG_NOSYSTEM=1, a home folder of the run, an empty credential.helper before the trusted helper, and the URL of the repository on GitHub. It refuses a new or changed link (mode 120000) or gitlink (mode 160000) and each change of .gitmodules. The implement, fix-checks and fix-conflict steps run on these phases. Each prepare phase token asks only for contents: read, pull_requests: read, issues: write, checks: read and actions: read, and each publish phase token asks for workflows: write only when the merged plan names a .github/workflows/ file (#6780). The withdraw of the review step deletes the branch from the clone of the plan, which no agent wrote, with a lease on the judged head. A verification command of a plan runs git only as the negative search ! git grep, which reaches no remote: in the checkout, any other git call would read the configuration that the agent can write.
    • Limits. A repository that keeps files in Git LFS cannot use the implement Job: publish pushes from a new repository with no hooks, so no LFS object goes to the server, and the runner image sets up no git-lfs.
    • The risk that stays. The token is in the environment of a child while it runs, so a process of the same user can read it. In the runner Job, only prepare and publish hold a token, and neither runs a program of the branch. --phase all runs the three phases in one process, next to the App key. It runs only where require_runner passes, and the runner Job gives each container its own --phase, which the admission policy roadmap-service-jobs pins for a Job of the Service. On a workstation, devops roadmap implement --group runs the agent in the checkout of the person, with the token of the person.
    • The tests. tests/core/test_process.py, tests/roadmap/phases/test_roadmap_phase_publish.py and tests/roadmap/implement/test_roadmap_implement_token_isolation.py fail when any of this breaks.
  5. GitHub API Agent Write Refusal: In local and cluster agent sessions (core.caller.is_agent_caller()), agents share the owner's GitHub credentials. devops gh api refuses mutating requests (POST, PATCH, PUT, DELETE) on protected route classes defined in CONST_GH_API_PROTECTED_ROUTES (src/devops_cli/config/constants.py): repository settings, rulesets, secrets, organization settings, and repository transfer (POST repos/{owner}/{repo}/transfer). The command normalizes endpoints by stripping scheme, host, leading slash, query string, and fragment before matching, names the matched route and owner step on refusal, and executes no external request. Reads (GET), --dry-run previews, person sessions, and open write routes (issues, pulls, labels, and workflow dispatches) stay allowed. tests/github/test_gh_api_agent_guard.py and tests/commands/test_gh_cmd.py verify these controls.


MCP Server on the Network

The streamable-http transport of devops mcp serve is a network listener, and it fails closed (src/devops_cli/ai/mcp/remote.py). It refuses to start without the mcp.token credential (DEVOPS_CLI_MCP_TOKEN, at least 32 characters), and it needs --allow-remote for a host that is not loopback. Every request must carry that token as a bearer token. The server compares it in constant time before any tool runs, and answers 401 otherwise. In the cluster, devops k8s push-secrets makes the token (token_urlsafe(32), kept in the keyring entry mcp_token) and writes it to Secret devops/mcp-server, which Deployment mcp-server reads with secretKeyRef. It writes the same value to the keys DEVOPS_CLI_MCP_STAGE_TOKEN and DEVOPS_CLI_MCP_IMPLEMENT_TOKEN of Secret devops/devops-cli, which the stage and implement clients send. The server is meant to be reachable only from the roadmap Service and the Job pods. No roadmap client holds the token now: the roadmap Service, a stage Job and a runner Job take their keys of Secret devops-cli with secretKeyRef and no MCP token (#6518), and their clients are off. The pods that hold the token are the MCP server and the pods that load Secret devops-cli with envFrom: a Job of CronJob devops-cli and a run of WorkflowTemplate rag-ingest. The NetworkPolicies of k8s/devops/mcp-server/ admit only the pods with the label app.kubernetes.io/name of roadmap-service or devops-cli-job (the label that build_job sets on every Job pod), on TCP 8001, in both directions. Review holds the two labels equal; no test reads the policies (#6060). The role of a connection is its path: /planning/mcp, /implementation/mcp and /review/mcp each serve a separate FastMCP server that holds only the tools of its role (src/devops_cli/ai/mcp/roles.py), so a tool outside the role does not exist on that path. A job role holds a tool only when the role table names it and the exposure table marks it read-only. The table names no tool that reads or writes a path that a model gives, because on the server the path is a path of the server. The ops role holds every tool, has no endpoint and is never served over the network. A role server has no resource, no prompt and no hydrate_tool_domain, so no connection changes what another connection sees. The server logs the role and the tool name of each call, and no argument. The route /healthz of the readiness probe needs no token: it reads no tool and no setting, and it gives only {"status": "ok"}. tests/ai/mcp/test_mcp_http.py and tests/ai/mcp/test_mcp_roles.py fail when any of this breaks.

Infra Repos

devops infra changes the hosts of an infra repo: a git repository with an Ansible inventory, its playbooks and roles (infra.repos). Each infra repo has an agent access level, infra.repos[].agent_access. At none, the default, an agent runs no command that reaches a host. At plan, an agent also runs status --ping, plan and drift. At safe, an agent also applies a plan that has no disruptive task and no task that check mode skipped, and uncordons a node. At full, an agent also applies any plan and drains, restarts and reboots a node with the node commands, one node at a time. Only a person sets the level. dan-petty/homelab is at full, because it exists to develop, troubleshoot and validate the features of the project.

These guards apply at every level and to every caller. An apply needs a plan of the same commit, playbook, limit and tags that is not older than infra.plan_max_age_hours. The commit is on origin. A fresh check of each disruptive host matches the plan. The command drains, changes, waits for Ready and uncordons one disruptive node at a time, and it uncordons only a node that was schedulable before. A host whose disruptive classes are all of the class service-restart-nodrain:<unit>, a restart of a unit that the host lists in devops_infra_restart_nodrain_units, is cordoned instead: it skips the drain check and the drain, the only check that reads the PodDisruptionBudgets before a host changes. That list is trusted: a person must confirm that it names only units whose restart stops no container, such as the k3s and k3s-agent units under KillMode=process. At full agent access, an agent apply opens a CloudNativePG maintenance window on single-instance clusters whose primary is on the disruptive node. Before patching, it verifies that git does not set spec.nodeMaintenanceWindow. It verifies that Argo CD self-heal does not overwrite the resource without an ignoreDifferences entry. It closes the window after uncordon and verifies cluster health. The cluster is healthy before and after each node. The first failure stops the run and leaves the node cordoned. An agent apply needs host key checks on. The node commands (devops infra node) have the same health gate, drain, waits and first-failure stop, one host at a time in the given order. An agent restart or reboot needs host key checks on, and only a person passes --force to the drain. Each run writes an audit record with the caller, the level, the repo, the commit, the plan hash, the hosts and the result.

Secrets and hardware stay with the owner at every level. An infra repo holds no secret. devops infra passes the SSH key of devops ssh and no other credential. The level stops an agent error; it is not a security boundary, because an agent with a shell can run ansible-playbook. So an agent changes a host only with devops infra, never with ansible-playbook, kubectl drain, make or a reboot over SSH.

GitHub Settings

devops tf manages GitHub organization and repository settings under tf/github stacks (ADR 0026). Each stack entry in tf.stacks[].agent_access admits only plan or apply, and every tf/github stack defaults to plan; only a person sets apply. When is_agent_caller() reports an agent session, devops tf apply and devops tf destroy refuse tf/github stacks before OpenTofu builds or starts, naming tf.stacks[].agent_access. Person sessions keep full apply and destroy access. Before any tf/github stack plan starts, devops tf plan checks the local run_gh core quota ledger against DEFAULT_TF_GITHUB_CORE_BUDGET_FLOOR (250 remaining) and refuses below the floor without making an external request. For an agent tf/github plan, devops tf plan mints a read-only installation token for devops-settings-reader from tf.github_reader.app_id, tf.github_reader.installation_id, and tf.github_reader.private_key (OS keyring tf_github_reader_private_key), and fails closed instead of falling back to writer App credentials. Passing --dry-run checks agent access and the local quota ledger without reading credentials, minting tokens, starting OpenTofu, or sending external provider requests.

A Finding with No Fix

A scanner can name a finding that no update of the pinned package solves yet. The agent then adds a time-limited ignore entry itself and does not ask the owner. The entry expires by itself, and the failing scan after the date is the reminder. The owner set these limits on 2026-11-07, and the owner can lift them.

When the rule applies. A scanner (Trivy on an image, OSV, uv audit or osv-scanner) names a vulnerable package or a vendored library, and no released version of the package that the project pins holds the fix. Prove it in a pull request comment: the fixed version that the scanner names, the newest release of the pinned package, what the go.mod or lock file of that release holds, and the date you read it. If any released version holds the fix, bump the pin instead, on the day the fix is published (Dependency Versions in CONTRIBUTING.md). Do not ignore the finding.

What the agent does.

  1. Add one entry to the ignore file of the scanner. For Trivy on an image, add it under vulnerabilities: in .trivyignore.yaml: the finding id, the paths that hold the Trivy target of the binary, and the purls that hold the package that Trivy reports, so the entry hides the finding in no other binary. The image scan action .github/actions/image-scan reads this file for each image. For osv-scanner on the root package-lock.json, add it under [[IgnoredVulns]] in osv-scanner.toml: the finding id, an effectiveUntil date-time, and a reason that names the tracking issue as #N. An entry applies before its expiry day, and the scanner filters it from the findings. Scope it as narrowly as the scanner allows: the finding ID, and the path or package when the file format holds them. Give it a reason or statement with the tracking issue, and an expiry date. The date is the day of the entry plus 3 days.
  2. Search open issues for a duplicate, then file the tracking issue "bump <package> and drop the ignore".
  3. Open the pull request with the entry.

Renewal. On the date, check again for a released fix. If one exists, bump the pin and delete the entry. If none exists, renew the entry for 3 more days and put the new proof in the pull request. The first entry and its renewals last at most 14 days in all. After that, stop and ask the owner: a longer ignore is the owner's decision. An entry that the owner names with another date keeps that date.

What the agent never does.

  • Ignore a finding of severity CRITICAL. Ask the owner.
  • Ignore a secret finding (gitleaks), a finding in code of this project, or a finding for which a fix exists.
  • Ignore a finding of a package that only the owner pins, by a decision that an ADR records.
  • Use a wildcard.
  • Lower the severity threshold, turn off ignore-unfixed, or turn off a scanner.
  • Add an ignore without a reason, an expiry date and a tracking issue.

Report. The pull request comment lists each ignore that the agent added, its expiry and its tracking issue. The final message of the agent says the same.

Dedicated Development Resources and Sandboxes

Dedicated development resources and sandboxes let tests and agent runs work inside controlled boundaries. These resources include the homelab, the devcontainer, project-owned test namespaces and repositories, RuntimeClass gvisor, the review sandbox and the planner run Job. Each name refers to its role, with no internal host name or private address.

Default. Every security control, configuration and guardrail applies by default. All automated checks enforce them.

Conditions. A control can change for a dedicated development resource or a sandbox only when all four conditions hold:

  1. Demonstrated need. Evidence records the refusals, failures or blocked work with counts.
  2. Boundary holds risk. A compensating control holds the risk, such as RuntimeClass gvisor, a deny-egress NetworkPolicy, a secret-free namespace or a scoped token.
  3. Narrow scope. The change applies only to one named RuntimeClass, namespace, repository or Job template, and a test proves it applies nowhere else.
  4. Recorded entry. The table below records the control, scope, compensating control, evidence, approver and YYYY-MM-DD review date. An empty table with only its header row is valid.

Never changed. This rule never changes the secrets rules or private-data rules of the public repository. It never changes main protection or the controls on production services that people use. Only a person merges pull requests or changes secrets, repository settings, organization settings and hardware.

Approval. The owner approves each entry of the table. An entry can name a class of changes, such as the allow list of RuntimeClass gvisor pods. Later changes in that class need only the review and an updated row.

Control Scope Compensating control Evidence Approved by Reviewed
The Trivy image scan finds the CVEs of the OS packages. The devcontainer image and the runner image (stage, implement and fix-checks Jobs). Both build FROM ghcr.io/dan-petty/devtools, which is on Debian sid. The Job pod mounts no ServiceAccount token, so it reads no Secret through the API. It runs as uid 1000 with a read-only root and no capability, under the NetworkPolicy of the namespace. The exposure that stays: the pod loads every key of the Secret devops-cli with envFrom, the GitHub App private key and the gateway key included. Only the code of the Job limits its GitHub token to one repository. #6518 gives the Job only the keys that it needs. Trivy finds no OS-package CVE on sid: 0 findings in 444 packages. With --distro debian/14 it finds 941, and 940 of them have no fix. The owner, 2026-11-19 2026-11-19
The Trivy image scan stops the build on a HIGH or CRITICAL finding that has a fix. The scan of ghcr.io/dan-petty/devtools and of each image built FROM it: the devcontainer image and the runner image. These scans send their findings to code scanning (exit code 0, SARIF) and stop no build. The Service and MCP server images keep the full gate. The Job pod of the row above, with the same exposure. The Renovate updates of the devtools repository take each newer tool release, and this repository takes a new devtools image each week through Renovate. The osv-scanner gate checks the npm and Python lock files. dan-petty/devtools#3: the Go binaries hold 353 HIGH or CRITICAL findings with a fixed version. 262 of them, 4 CRITICAL, are in tools at their newest release, so no change in this project can pass a gate. The runner image of #4361 holds 286 such findings in the devtools tools and none in its venv. The owner, 2026-11-19 2026-12-20

Judging a Trivy-config Alert

The Security Scan step of CI uploads the results of trivy config to code scanning. Each result is an alert of the tool Trivy-config. The workflow .github/workflows/trivy-config-alerts.yml runs devops scan alerts each day, after the CI run on main that uploaded the alerts. The command files one issue for each rule and file that has open alerts and no open issue: at most 5 in one run, the worst severity first. The title is fix(security): judge Trivy-config <rule-id> in <path>.

Who judges, and in what time. The owner judges a CRITICAL alert within 24 hours. An agent judges an alert of severity HIGH, MEDIUM or LOW within 14 days. After 14 days the owner decides.

What judging means. Do one of these, and close the issue with it:

  1. Fix the file in a pull request that closes the issue. This is the first choice.
  2. If the fix breaks the workload or needs a change that is not released yet, add an entry to .trivyignore.yaml. Give it the rule id, the paths of the file, a statement that holds the reason and the tracking issue, and an expired_at date. devops scan report names this file, and Trivy stops applying an entry after its date. An agent follows the limits of "A Finding with No Fix": 3 days, renewed at most up to 14 days in all, never for a CRITICAL alert, never for a secret. A longer date is the decision of the owner, and the statement names that decision.
  3. A person dismisses the alert in code scanning, with a reason. An agent does not dismiss an alert.

Reporting a Vulnerability

We deeply appreciate responsible security disclosures. If you discover a security vulnerability within DevOps CLI:

  1. Do NOT open a public issue, pull request, or discussion.
  2. Report the vulnerability privately via GitHub Security Advisory.
  3. If you cannot use GitHub Security Advisories, contact the project maintainers directly via email at contact@danielpetty.com with the subject prefix [SECURITY VULNERABILITY].

What to Include

To help us triage and remediate the issue rapidly, please include:

  • A detailed description of the vulnerability and its potential impact.
  • Affected component or CLI subcommand.
  • Step-by-step reproduction instructions or a minimal Proof of Concept (PoC).
  • Any proposed remediation or mitigation steps.

Response & Remediation SLA

  • Initial Triage & Acknowledgment: Within 24 hours of receipt.
  • Vulnerability Assessment & Severity Rating: Within 48 hours using CVSS v3.1 scoring.
  • Patch Development & Release: Critical security fixes merge into main and ship in a release within 72 hours of triage confirmation.
  • Public Disclosure: Coordinated after the patch release is confirmed and deployed.
Learn more about advisories related to dan-petty/devops-cli in the GitHub Advisory Database