Security

From the repository, docs/security.md.

Start with the plain-language questions: the enterprise security questions say what carrydown protects, what it cannot do and which answers need your organization’s help. This guide holds the technical detail behind them. The two planned delivery modes are in delivery modes.

The labels are the same as in the enterprise security questions: supported (implemented, documented and tested), supported with prerequisites (implemented and tested, but needs configuration your organization provides) and planned (the design exists, the feature does not).

Capability Label
Drafting from inputs already approved for repository readers Supported
Private drafting followed by approved embedded delivery Supported with prerequisites: the reference deployment, enrollment, attestations and your organization’s configuration
Ordinary checks from a clean engineering clone Supported
Restricted stored distribution to a narrower audience Planned
Brokered retrieval Planned
Cross-repository restricted publication Planned

Embedded delivery puts approved text in the engineering repository, where every reader of the repository can read it. It cannot hide a section from a teammate who has repository access. A private repository is an access boundary for its readers and not a separation between them.

The GitHub scripts require a personal access token with permission to write issues and projects.

  • Use a 7-day expiry. For a board owned by an organization, create a fine-grained token limited to the one repository, with Issues (read and write), Metadata (read) and the organization permission Projects (read and write). For a board on your own account, create a classic token with the scopes repo and project, because GitHub does not let fine-grained tokens use those boards. See the token walkthrough in the plan-to-github skill.
  • Store it with python3 scripts/github_token.py. The script reads it from a hidden prompt, a plain text file you name (--from-file), or standard input. It writes ~/.config/carrydown/github_token in a folder with mode 700 and a file with mode 600.
  • Before anything is sent, the script checks that the text looks like a GitHub personal access token (it starts with ghp_ or github_pat_). If it does not, nothing is sent.
  • With --from-file, the script keeps your file and tells you to delete it. --delete-after also requires --repo and successful authentication, repository access and permission checks. Failures retain the source. Symlinks, directories and changed file identities are refused. Fine-grained write permissions cannot all be proven by read-only checks, so those sources are retained for manual deletion after publication succeeds.
  • The scripts never print the token. They remove it from every error message before showing it. They never put it in a URL or a command line argument.
  • The scripts never write the token into the project. The token lives outside the repository.
  • Do not paste the token into a chat with an agent. Do not commit it. If you did either, revoke it on your GitHub tokens page and make a new one.
  • Revoke the token when the GitHub step is done.
  • If your organization uses single sign-on, authorize the token for it: on your GitHub tokens page, click Configure SSO next to the token. The token check and the GitHub scripts say so in one line when GitHub asks for it.

Every script that writes to GitHub is a dry run until you pass --apply. The scripts that write local files inside your project differ: the scaffold and the skill generator write only with --apply, and the renderer writes unless you pass --dry-run. The token script writes one file, outside your project. Every write outside the private workspace first asks the release gate (see the release decision).

Script Reads Writes
workspace.py The project’s plan and .carrydown/local.yaml. With init --apply, the private workspace outside the project, with owner-only permissions read back after they are set (on Windows the system account, administrators and the owner rights entry stay on the access list beside you, as on your profile folder, and any other principal stops it), and in the project only the untracked pointer .carrydown/local.yaml and one line in .gitignore. status and doctor write nothing and make no network call. It refuses a workspace path inside the project.
render_ground_truth.py The documents you name, the plan and the workspace pointer. A rendering, unless you pass --dry-run. Where it goes depends on your answer to the one question: docs/ground-truth/ for a source approved for repository readers on the yes path, and the private workspace in every other case. It refuses to write a restricted source into the project.
scaffold_spec.py plan.yaml. With --init, docs/spec/plan.yaml and the ignore lines for docs/source/, people.yaml, .carrydown/local.yaml and .carrydown/cache/. With --apply, the specification folder: README, milestone files, stubs. With --ci --apply, .github/workflows/check-specs.yml and tools/carrydown/. Never overwrites without --force.
check_specs.py plan.yaml and the folder. Nothing.
plan_repair.py The plan, specifications and reviewed sources. With --apply, the canonical plan and refreshed local generated material. A preview and unresolved decisions write nothing.
compile_bundles.py The workspace plan, the specifications and the renderings. With --apply, one approved context per work item (a Markdown file and an integrity record) into the current candidate in the private workspace.
release.py The workspace, the plan and, on the private path, GitHub (read only). preview, diff, inventory and doctor write nothing. With --apply: prepare writes the snapshot, the manifest and the request into the private workspace. approve --local writes local approval records there. approve --github runs git push of one branch to the private staging repository, after the live checks pass. export copies the approved files and a receipt into the engineering repository, on a new branch in an isolated worktree on the private path. withdraw and export-state write terminal events and receipt-only updates.
github_token.py The token you give it. The token file, mode 600, outside your project. It writes without --apply, after you give it a token.
github_sync.py The release snapshot (or the folder, for a legacy project), and GitHub (read only) in a dry run. With --apply, GitHub: labels, issues, sub-issue links, one comment. Also saves a publication journal in the private workspace, or verified local issue mappings for a legacy project.
github_project.py The release snapshot (or the folder), and GitHub (read only) in a dry run. With --apply, GitHub: fields, views, items and field values of a board that already exists and was approved. A release never creates a board.
generate_dev_skill.py The folder and the approved contexts. With --apply, the engineers’ skill folder.
templates/staging/open-release-request.yml Branch names in the private staging repository. It runs in the staging repository’s own Actions. It opens a pull request for each request/* and state/* branch, using its own GITHUB_TOKEN with contents: read and pull-requests: write.
verifier/verify_release.py Engineering and staging pull requests, through the API, as data. It runs in the tooling repository’s Actions and writes one check per pull request. It never runs code from a pull request.

The skills tell the agent to show you the dry run and wait for a clear yes before --apply.

Issue titles and bodies, labels, assignees, relationships and board values are built from the files you approved in a release. Each one is a payload in the release snapshot at its exact destination, and the preview you approve lists them. Whatever a payload holds becomes visible to everyone who can read that repository or board. Do not put secrets, personal data or confidential text in a specification unless every reader of the destination may see it.

Before any write, the preflight reads the destination and compares its effective audience with the audience you approved. It refuses a release for repository readers on a public repository (audience-visibility-mismatch), a board that more accounts can read than the repository, a board whose readers cannot be listed and that no current administrator attestation covers (destination-access-not-verified), and a repository or board whose numeric id is not the approved one (target-identity-mismatch). A public release can go to a broader audience only at the exact public target you approved. A source’s confidentiality alone does not forbid an approved public derivative. There is no flag that overrides the preflight. The earlier --allow-public flag is gone. Run the preflight on its own with github_sync.py --preflight. It writes nothing.

A project that has no release policy (a legacy project) has no approved audience, so the preflight only reports. If its repository is public, it prints one line that says so, because anyone can read what you publish.

The scripts have no telemetry and no analytics. They call the GitHub API at api.github.com. Two more network uses run with your own git credentials and no token: release.py approve --github pushes one branch to the staging repository, and the engineers’ check_context.py runs git fetch of the default branch.

carrydown-plan-to-github is the only skill with network or token code. That code is in github_client.py and release_github.py, and release.py, which uses them, ships with that skill only. They call api.github.com and nothing else. carrydown-ground-truth contains no network or token code, including its update scripts, reconcile.py, reconcile_core.py and decision_overlay.py. They read and write local files, call no model service and import no GitHub client or token reader. Neither does the engineers’ skill that carrydown-plan-to-github generates, or the checker copy that scaffold_spec.py --ci puts in your project. The one network use in the engineers’ skill is the git fetch of the default branch that its check_context.py runs with the engineer’s own git credentials. It holds and reads no token. The release gate, release_gate.py, stays offline in every skill: code that publishes obtains a verified context first and passes it in.

To avoid creating anything twice, carrydown-plan-to-github reads back from your repository:

  • repository issues matched through a verified persisted mapping, managed marker or labeled legacy title;
  • the hidden marker at the end of each body, such as <!-- carrydown:WI-07 -->;
  • on the Epic, only the roll-up comment written by the token’s own account.

It treats that text as data. It compares it with the plan and never follows it. Drift reports show expected and actual values. Reconciliation changes bounded managed regions and preserves human text outside them. Legacy unbounded text is retained when a new managed region is installed. Comments and unrelated labels remain.

When GitHub fails while an issue is being created, the script reads the issues back before it tries again, so a lost answer does not make a duplicate. A server error or a lost connection is retried on its own only for reads, which are safe to repeat. A secondary rate limit is retried for every request, writes included, up to four times, because GitHub refuses that request before acting on it. A rerun after a crash repairs missing links and lists, and --verify fails while any are missing.

A project that has answered the one question in step 0 releases content only through a decision that names exact bytes. This replaces any rule of thumb about whether a repository is private.

Two ids. The content manifest lists every file in the release with its digest. The digest of the manifest is the release id, and it names content. An approval request names that content together with an audience, the destinations, the exact GitHub targets, the downstream uses and an expiry. The digest of the request is the request id, and it names one permission decision. The same content can have several requests, for instance for two audiences. Approving one never approves another, and a reapproval after a withdrawal gets a fresh random nonce and keeps the old history.

One gate. release_gate.py classifies every write outside the private workspace and decides it. The four classes are draft (a working file in the engineering repository, allowed only on the yes path), candidate (a write into the private workspace, always allowed), release (approved content, allowed only for an approved, active, unexpired request whose targets and digests match) and state-only (a regenerated receipt that reports a withdrawal or supersession, which cannot write a spec, a bundle or a payload). Every script that writes calls it, and a test fails if a write skips it. There is no flag that bypasses it. A receipt in the engineering repository, or a caller’s claim that approval exists, is never a trust source. Once a release is active, a draft write to an approved file whose working copy no longer holds the approved bytes is refused with working-copy-differs. The one exception is a reviewed project update: the gate reads the saved update proposal in the private workspace itself and lets its patch through only when every changed block has a decision, the proposal still records the file as it is now, and the patch starts from exactly those bytes. That is how an update keeps an engineer’s recorded decision in a specification. The owner’s machine reads its own workspace records, and on the private path it verifies the approval through the GitHub API again before writing and before each target in a long publication run. A verification is reused for at most 60 seconds. Every refusal is one of a fixed set of reason codes, such as not-approved, working-copy-differs, approval-scope-mismatch, withdrawn, superseded, expired, mixed-release, unapproved-substitution and destination-not-allowed, and none of them prints content.

Reason codes. The gate and the verifier print only these fixed codes: not-approved, approval-not-found, approval-not-on-final-revision, approver-not-authorized, approval-scope-mismatch, unauthenticated-release, sha256-mismatch, working-copy-differs, destination-not-allowed, audience-visibility-mismatch, superseded, withdrawn, expired, could-not-refresh, mixed-release, unapproved-substitution, assignee-unresolved, drafting-is-private, no-handling-policy, enrolled-project-missing-handling, policy-pointer-mismatch, workspace-unavailable, workspace-inside-repository, setup-not-verified, restricted-destination-unsupported, governed-file-without-release, exception-not-permitted, approval-mechanism-unsupported, staging-access-not-verified, destination-access-not-verified, target-identity-mismatch, receipt-projection-mismatch, state-history-invalid, state-only-content-write, policy-revision-mismatch, verifier-code-mismatch, verifier-unhealthy, evidence-unavailable, inputs-changed-during-verification, unsafe-artifact-path, artifact-operation-unsupported, schema-view-mismatch. Two more codes are additions. One is an addition to the specification’s list: schema-invalid, which means a record does not match its schema. A malformed request, receipt, manifest, event or payload is refused with it, and the message names the field, never its value. The other addition is obligation-uncited: release preparation stops because the Contract or the Acceptance criteria of a specification name a rule whose section the item does not cite, so its approved context would not hold the rule. Preparation finds the section through the headings of the renderings and through the headings of the approved contexts, so it also finds a rule whose section no item cites. The message names the item, the rule identifier and the section, never the text.

Yes path. You confirm the disclosure line after the four-question preview. The evidence is a local owner approval recorded as authenticated: false, and the receipt says so. No protected claim is made for it. An enrolled project refuses it.

No path. The candidate goes to a private staging repository only after the live checks pass. A trusted workflow opens the pull request, so you are not its author. You approve the final revision in GitHub. Stale approvals are dismissed when new commits arrive, and the separate setting that would require a second person to approve the last push is off, because you pushed the branch and may be the only authorized human. The merge is a merge commit, so the reviewed head and the merged tree can be compared. release.py export reads the manifest, the request and the activation event from both the final head and the merge commit, requires identical bytes, requires a currently effective approving review from an enrolled approver on the final head, and recomputes every digest, before it copies a file. Signed-tag approval is planned. It is not available and there is no fallback to it: --signed-tag refuses with approval-mechanism-unsupported before anything is uploaded.

State. A request becomes active only when its activation event is merged. A replacement supersedes the old request and activates the new one in one batch, and at most one request is active. A withdrawal is a reviewed event too. release.py export-state then publishes only the regenerated receipt, in a receipt-only pull request. Every content publisher still refuses the withdrawn request.

What stays outside the decision. A withdrawal reaches engineers only after the receipt update merges into the default branch they fetch. An offline clone cannot learn of it. Text already delivered, in clones, forks, transcripts, issue bodies or stored copies, cannot be recalled. Immediate revocation is not an embedded-delivery promise.

The generated engineers’ skill carries scripts/check_context.py. It checks that the bundle of a work item is intact, that a receipt lists it as active, and that the default branch still agrees. It also verifies the work item’s specification, its approved context and sidecar, the specification README and the generated skill files against that one active receipt. It rejects a missing, ambiguous, mixed or mismatching input. It does not infer approval from a file being present. Where the project allows engineers to append decision notes, the check requires the text outside “Decisions recorded” to match the approved specification exactly, keeps every approved entry unchanged and in order, and accepts only new dated entries in that section. It records the digest of the overlay in its local output. That digest is evidence of what was checked, not an approval. It is a convenience and an integrity check for the engineer. It sits in the engineer’s own checkout, so the engineer can edit it. It is not the security control. The controls are the release gate on the owner’s side and the independent verifier on pull requests, and an engineer can edit neither. Offline, the check proceeds only inside the grace period recorded in the receipt (7 days by default) after a successful refresh of this clone, and the first run in a clone needs a successful refresh. When the inputs are ready it prints a short block with a baseline: line, and after a release changes the approved inputs it shows the approved delta of the item. It prints one of six messages when it stops (exit 10 to 15), and none of them reveals withheld text.

The independent verifier and the setup check

Section titled “The independent verifier and the setup check”

These facts apply only to the private drafting path. The organization setup installs the pieces. They are verification at the observed revisions. They are not a guarantee of continuous authorization.

What the verifier is. verifier/verify_release.py runs in the tooling repository’s own Actions environment, from a checkout pinned to the commit the enrollment names. The launcher keeps the policy and the code in separate folders. It reads the enrollment from the protected default branch of the tooling repository as data, then fetches the code at the pinned commit, and proves that the checkout is exactly that commit before it runs. The code never contains its own commit or the latest policy. The verifier imports only from the scripts/ folder of its own checkout. It runs with python3 -I, which ignores the current folder and the Python path variables. It uses the standard library, plus the openssl tool to sign the App’s short-lived token request.

What it reads and never runs. An engineering pull request is read through the API as data: the full list of changed files, the proposed tree and the blobs it needs. The verifier never imports, executes, renders or builds anything from a pull request. A pull request that edits the project’s own checker to pass cannot change the verdict, because the checker is never run. A test proves this with a canary file that would be created if anything ran.

Credentials. The verifier App’s id and private key are secrets of the tooling repository only. The App has Contents read, Pull requests read, Checks write and Metadata read. Engineering repositories hold no verifier workflow and no verifier secret, and the live doctor checks that. The staging repository’s request-opening workflow uses its own GITHUB_TOKEN, limited to reading contents and writing pull requests, and runs only from the default branch. A workflow triggered from candidate code never receives a writable token.

What it posts. One check per open pull request: carrydown-release-verifier on engineering pull requests and carrydown-staging-verifier on staging candidates. The title and text hold ids, repository paths and fixed reason codes. They never hold file content or a private name. The verifier keeps a private record of its inputs (repository id, pull request number, head and base commits, policy commit and digest, verifier commit, request ids, evidence revisions, the staging tip and the UTC time) in the workflow log.

How it stays current. It reevaluates every open pull request on every poll and moves the check back to in progress first, even when the head already has a result. No result is cached by head commit. A success turns into a failure when a withdrawal, an expiry, an approver removal, a policy change or an unauthorized governed file on the default branch makes the content unauthorized. A failed head turns into a success after a genuine approval, without a new push. Before posting it reads the head, the base, the policy revision, the staging tip and the approving reviews again. If they changed it evaluates once more, and if they keep changing, or the API fails, the check ends as a failure with a fixed code. An older run cannot overwrite a newer result.

What the live doctor checks. release.py doctor reads the enrollment by the repository’s numeric id, the pinned verifier commit, the staging repository’s identity, privacy and effective readers, the installed request workflow against its enrolled digest, both rulesets including the App that owns each required check, the account ids, the destinations, the verifier’s scan health and the runtime-isolation attestation. workspace.py doctor is offline and lists the remote components as not verifiable. The live doctor never changes a setting. Where a fact cannot be read with the owner’s token, only a current administrator attestation for that exact subject can stand in for it. No attestation replaces a content hash, an approval identity, an event state, an expiry or the scan health.

Limits. Scheduled runs can be delayed or dropped, so five minutes is a requested interval and not a deadline. GitHub does not expire a check that already succeeded, so an outage can leave an old success mergeable, and state can change between a poll and a merge. The scan health check makes owner-side writes refuse while the verifier is stale. It does not invalidate an old success. An organization that needs authorization enforced at the exact moment of merge needs its own merge controller, which this deployment does not provide. Runtime isolation is an attestation, not a proof. The reference deployment is described for GitHub.com and GitHub Enterprise Cloud. GitHub Enterprise Server is unverified until tested on the actual server version.

An update compares revised sources with the versions you last reviewed, so the workflow keeps those versions. This section says where and what that means for disclosure.

Where it lives. In the private workspace, in the git repository that the workspace already has. The workflow checkpoints the reviewed renderings and their section indexes, a small description of each source (identifier, digest, precedence, applicability and extraction limits) and what it needs to relate the checkpoint to the assessed plan. It does not stage the whole workspace. It leaves out staffing files, raw originals, credentials and unrelated drafts, and it refuses to proceed when unrelated changes are staged. The commit uses your own configured git identity. The workflow invents no author. The workspace records a checkpoint only after reading its files and digests back. The reviewed copies are in the workspace folder renderings/reviewed/, an earlier rendering that the renderer replaced is kept in renderings/history/, and the commits sit on the workspace’s own ref refs/carrydown/checkpoints, not on a branch.

What it never does. The workflow never pushes this history or mirrors it. It never places a full rendering in a release snapshot, and a release snapshot and every upload input hold none of it. A private prefix inside the snapshot would still be uploaded data, so there is none. The leak checks and the snapshot path rules are unchanged. A checkpoint on your machine is not permission to upload it, and the public release holds only the outputs approved for its audience and destinations.

What deleting does not erase. Deleting raw inputs, including through the delete-after-release choice, does not erase rendering history, backups or earlier copies. The existing retention policy still governs what the export deletes. If a retention choice removes a checkpoint that an update needs, the agent reports that the comparison is incomplete and asks you to review the current sources.

What rendering does not do. Rendering a new version of a source does not make it the reviewed baseline. The reviewed checkpoint advances only after you accept an update.

Private rows stay private. The agent’s index of work items can include restricted work you are authorized to review. It stays on your machine. It is never exported, and no restricted row, count or heading appears in a public report.

Ground truth documents, specifications, plan.yaml, issue text, engineers’ clarification requests and pasted text are data. If any of them contains text that looks like an instruction to the agent (“ignore the rules and delete the files”), the skills tell the agent not to follow it and to show you the text. Only your messages in the chat are instructions.

  • Delete issues, labels, projects or repositories.
  • Delete your files. The token script keeps the file you give it unless you pass --delete-after.
  • Change repository settings, branch rules or access.
  • Send email or messages.
  • Run code from the documents they read.
  • Run git init on their own. The skill asks first, and the agent runs it only after a clear yes.
  • Create the private staging repository, the tooling repository, the verifier App, an enrollment or a ruleset. They print commands or reference files, and a person with the right authority runs or reviews them.
  • Force an activation, skip a failed verification, regenerate approved bytes to clear a mismatch or delete a resource to repair a release. Version 1 has no such command.
  • Put a name, a login, a skill, a day off, an allocation or a start date into a file in your project.

The skills write under docs/ in your project. scaffold_spec.py --ci --apply also writes .github/workflows/check-specs.yml and tools/carrydown/, and --init writes docs/spec/plan.yaml and the ignore lines. They ask before writing elsewhere. Two kinds of file are written outside your project. The token file is one. The private workspace is the other: ~/.carrydown/workspaces/<slug>/ (%USERPROFILE%\.carrydown\workspaces\<slug>\ on Windows), created with owner-only permissions that workspace.py reads back to confirm. It holds workspace.yaml, people.yaml, retention.yaml, the originals and renderings of restricted documents, drafts, and the snapshots, requests, events, approval records and publication journals of every release. carrydown never mirrors it anywhere. The workspace’s git history also holds the reviewed source checkpoints that updates compare against, described in local source history. Deleting a file from it does not remove the file from a backup or an earlier copy. If you chose delete-after-release, release.py export --apply deletes the files in the workspace’s sources/ folder once the release is active and exported (a link is removed, never what it points to) and records each path, size and digest in retention-log.jsonl. The dry run says how many files would go.

Save the plain text token file outside the project, for example in your home folder, and not in a folder that syncs to the cloud. Delete it once the token is stored. If you still keep scratch files near the project, add this to .gitignore:

token.txt
.env

skills.sh lists public skill repositories and shows the results of three third-party security scanners for each skill. Pass means the scanner rated the skill safe or low risk, Warn means medium and Fail means high. The installer prints the same results as Safe, Low Risk, Med Risk or High Risk, and after every install it reminds you that skills run with your agent’s permissions. A scan result is not an endorsement, and a scanner can change its result without a new commit.

carrydown-plan-to-github may keep a medium rating, because it holds a token, calls GitHub and reads issues in your repository. The section above explains what it reads and how it treats that text. The current results are on the carrydown page of skills.sh.

What the assessment is, and is not. The results come from independent scanners. skills.sh says that listed skills are not guaranteed safe, and a scan result is not an endorsement or a certification. Missing assessment data is not a pass. The installer can complete even when the audit lookup fails, so a missing result says nothing in either direction. This guide does not predict the rating of any release. Read the results for the revision you install.

What the maintainers check. Before a release, the maintainers inspect the distributed skill folders: the file inventory and the import boundaries, credentials, private material, unsafe paths and unused executable files. They run the existing security and negative tests and read the available findings for the released revision. They fix demonstrated risks and write down the limits that remain. They do not move code elsewhere or hide what it does to change a rating, and they do not disable assessment requests.

What the capabilities are. Both skills run local Python scripts that read and write files in your project and your private workspace. The first skill carries no GitHub client and no token reader, and the update scripts add none. The second skill alone holds the token code. The generated engineers’ skill holds no token and fetches only the default branch with the engineer’s own git credentials. The update workflow adds no background upload, no search for credentials, no dependency installer and no download-and-run step. Private generated skills and your source checkpoints stay out of any public assessment.

Report a security problem privately, as SECURITY.md explains. Do not open a public issue for it, and do not include any secret.