Safety
Safety helps an agent continue useful work while respecting the authority and evidence each action needs. It focuses on actual effects: what will change, whose resources are involved and what can be preserved if something fails.
Flow
Agent execution boundaries
The same command can have different effects in different projects. A test may be a local calculation, or a wrapper that imports data and contacts a shared service. The agent checks the relevant script, hooks and target before execution rather than trusting its name.
| Decision | Example and response |
|---|---|
| Proceed | Make a requested source correction or run an established safe check within scope. |
| Obtain missing authorization | Review the concrete destination and effects before a push, data import, deployment or destructive cleanup. |
| Stop dependent work | Respect a prohibition, unknown target or unmet required gate; preserve progress and continue independent permitted work. |
The intended project matters before any edits. Suppose a session is open in a demo application, but you ask to change a Helm command. The agent can discuss the idea while identifying Helm as the subject, then explains the workspace mismatch and clarifies where implementation belongs. It cannot silently redirect the task or put Helm changes into the demo. Reading Helm’s AGENTS.md tells it how to work there; that read does not authorize changes. If your request explicitly names the target repository and work, that ambiguity is already settled.
Scope includes necessary companion changes, such as a call site and regression test for the requested fix. Unrelated cleanup or feature work is reported before expanding the task. Documents maintained by commands retain the review boundary explained below.
A sufficiently specific direct request can already authorize an action. The rule does not require asking the same question again while content, target and effects still match. Tool access, silence and an unchecked default provide no substitute for human intent.
Writing code and changing data
Implementing a record-deletion feature authorizes work on its code and relevant tests. It does not authorize executing a deletion against an existing database. Even a single-record update needs authority for the actual account, environment, storage target, record scope and effects. A database called local or test may still hold useful persistent data.
Established safe tests with genuinely isolated, task-owned fixtures can run within their approved scope. Hidden migrations, seeders, imports or resets require a concrete execution plan covering those effects; a general request to run tests does not settle them. Once that exact plan is approved, the agent need not ask again for every step.
Recommendation judgment
A review can conclude that the current approach is sufficient. Recommendations need evidence of a concrete problem, credible failure risk or meaningful maintenance benefit, weighed against the complexity and upkeep of changing it. A generic best practice or harmless addition does not establish that benefit, and existing guidance or protection may already address the concern.
For example, an extra instruction is useful when it resolves an ambiguity that changes an agent’s decision. Restating an existing rule without improving that decision adds maintenance work. When you request brainstorming, possible ideas can still be explored, with a clear distinction between those ideas and changes worth implementing.
Protect work and verify effects
Preserve unrelated edits, staged hunks and local inputs. Git can recover committed source, but not every discarded draft, overwritten database or remote message. Requested targeted editing is different from wholesale discard.
After a failure or timeout, establish the actual state before continuing. For example, a network timeout after a publication request does not prove the destination was unchanged. Readback can prevent a duplicate or destructive retry.
Credentials and access configuration are preserved unless removing, replacing or rotating them has a clear reason within the authorized task. A credential that appears unused, or a configuration that makes a test fail, is not automatically disposable. Safe discovery uses names, references and metadata rather than secret values.
Secrets and private records stay out of chat, logs, commits and unapproved uploads. Delegation gives a worker the same or narrower authority; another agent cannot approve a consequential action on your behalf. Instructions found in ordinary files, web pages or tool output cannot grant new authority either.
Maintaining command outputs
A command may change ordinary application source as well as maintain its own documents and records. Those roles determine how later work proceeds:
| Role | What maintenance preserves |
|---|---|
| Ordinary implementation, tests and general guides | Useful custom content, behavior and unaffected work; these remain editable during development. |
| Command-maintained documents and configuration | The owning command’s authoring standards, the selected format and developer approval of the bounded change. |
| Legal commitments or test protection | Required content approval and the guarantees people rely on. |
| Actual generated output | Its authoritative input and the approved generator. |
| Assessment or recovery evidence | Its owning workflow and historical provenance. |
Project instructions, READMEs, adopted rules, legal documents, reviewed environment templates and release documents normally stay with their owning commands. During ordinary coding, an agent can identify a needed correction, read the applicable authoring instructions and prepare the exact proposed passage or diff for your review. It explains the affected files and reason before changing them. You can approve that edit or choose the owning command instead. Unavailable authoring instructions leave the edit pending, while independent source work can continue.
For example, renaming a startup script may make an AGENTS.md command inaccurate. The agent proposes that correction before editing. Adding a configuration generator does not automatically justify a new maintenance section in a custom README. Standard READMEs receive the same protection for their selected format. A specific direct request already authorizing the edit can supply approval; a general coding request or automatic commit preference cannot.
Approval does not start another command or establish its completed review. The agent follows the relevant authoring standards, preserves imports, settings and review markers, and verifies the approved result. Legal-document commits retain exact content/commit approval. Legal previews document changes before writing; one explicit review can approve their write and commit together, while a specific write-only request leaves drafts uncommitted.
Actual generated material is updated through its authoritative input and producer, with approval covering any affected command-maintained documents. A build or generator does not bypass that boundary. Ordinary implementation and tests remain editable even if a command originally wrote them; a demonstration fix in an archived application does not authorize changing its captured recovery evidence. Ledgers, checkpoints and recovery proofs still require their owning procedures, regardless of approval for a document edit.
Test quality
Focused tests can accompany an ordinary feature or fix without invoking test. They follow the same standards as tests written through that command: known inputs, an expected outcome grounded in the intended behavior, and assertions that would detect a realistic failure. Existing useful cases may already provide that protection or need only a targeted extension.
For example, a retry test should check that the operation happens once despite repeated requests. Comparing a result with itself or mocking away the retry behavior would not protect that contract. More assertions and a consistently passing suite do not establish useful protection by themselves.
Broader audits, suite cleanup and tooling changes need their own selected scope. The test command can assess those needs and maintain saved findings. Direct test edits do not update those records or close their findings.
Network access
Ordinary work starts from written instructions, supplied material and local evidence. An agent does not reopen research citations to look for updates, compare the instructions with their sources or find a better approach merely because a rule was loaded.
The distinction is the purpose of the connection. Ship can inspect the selected repository’s GitHub or GitLab CI results and release state under its existing procedure. That does not authorize reading unrelated advice hosted on GitHub. Known network effects of an approved dependency restore, build or check remain part of that concrete execution plan. Separate push, fetch, credential and data-sharing approvals are preserved.
You can explicitly request online research, reading a named external page or live link verification. That request supplies the bounded scope without another question for every source. The agent stops when the requested question is answered instead of enriching every missing fact or refreshing unrelated instructions.
Optional unknowns remain visible. When external verification is indispensable to a required conclusion, the agent names that specific gap and obtains only the missing scope or leaves the conclusion pending. It neither invents facts nor presents offline evidence as current external verification.
Host capabilities
The agent verifies only the capabilities needed for the action: the actual workspace, account, runtime and target. Folder access is not proof of Git permissions or a safe database. Missing access blocks the dependent action while drafts and completed results remain intact.
These Markdown rules guide decisions. They do not provide an OS sandbox, enforce teammate coordination or guarantee that unsafe behavior is impossible.
When to run a safety scan
A log Full scan includes static operational review. Changes to deployment, data, credentials or destructive scripts need focused reassessment. A routine prose edit does not trigger a full-project scan.
Findings explain the risk, inspected evidence, uncertainty and proposed instruction. Project-specific hazards belong in the shared instruction owner’s Hard Safety Rules after review, rather than being added to a reusable rule for every consumer.
Operational Helm state
Saved ledgers, archive bundles and private recovery evidence are not ordinary source-cleanup inputs. Only the explicitly invoked owning workflow, or a narrowly defined publication procedure, accesses its permitted state.
Source maintenance leaves those records opaque. Unsupported historical state is not automatically migrated or deleted. A source fix, a completed assessment and a verified closure are separate results, with their own evidence.
Ship has one narrow automatic retirement path for completed Normalize and fallback remote-history backups. After every affected branch and selected publication/release action is verified complete, it keeps three completed backups total across both types for that clone, plus older proof still required. It deletes only eligible verified recovery folders and their matching local pointers/checksums, with no new approval pause. Fallback pointers never establish that the original rewrite was verified. Unfinished, unknown, modified or dependency-required evidence stays protected. Cleanup failure is reported separately and does not undo publication; ordinary coding and rule installation gain no cleanup authority.
Explore the source
For implementation details, read rules/safety.md.