secretops 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
secretops-0.1.0/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ secretops
2
+ Copyright 2026 feist
@@ -0,0 +1,390 @@
1
+ Metadata-Version: 2.4
2
+ Name: secretops
3
+ Version: 0.1.0
4
+ Summary: A CLI-first broker for approved secret operations without exposing values to coding agents
5
+ Keywords: secrets,devops,coding-agents,cli
6
+ Author: feist
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: System Administrators
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Topic :: Security
18
+ Classifier: Topic :: System :: Systems Administration
19
+ Requires-Dist: pydantic>=2.13.4
20
+ Requires-Dist: pyyaml>=6.0.3
21
+ Requires-Dist: rich>=15.0.0
22
+ Requires-Dist: typer>=0.26.8
23
+ Requires-Python: >=3.11
24
+ Project-URL: Homepage, https://github.com/feistify/secretops
25
+ Project-URL: Documentation, https://github.com/feistify/secretops/blob/main/docs/INSTALL.md
26
+ Project-URL: Repository, https://github.com/feistify/secretops
27
+ Project-URL: Issues, https://github.com/feistify/secretops/issues
28
+ Description-Content-Type: text/markdown
29
+
30
+ # secretops
31
+
32
+ secretops is a CLI-first broker for developers who want coding agents to manage secret operations without seeing secret values.
33
+
34
+ Humans enter credentials and approve writes; agents prepare plans and execute approved operations through a restricted SSH wrapper. Store an API key in Infisical, then let an agent sync it to GitHub through a separately approved plan.
35
+
36
+ **v0.1.0, early-stage software.** The supported installation path is a local broker on Ubuntu 24.04. Python 3.11 or newer is required; the clean-VM installation was tested with Python 3.12.3, Infisical CLI 0.44.2 and GitHub CLI 2.102.0. See the [validation record and its limits](docs/validation/local-broker-installation.md).
37
+
38
+ | Available now | Current limits |
39
+ | --- | --- |
40
+ | Hidden human entry, generation, rotation, import and environment copy in Infisical | One Infisical server, project and folder per broker; no OpenBao adapter yet |
41
+ | Saved plans, destination binding, human approval, safe audit and explicit write outcomes | Infisical create-only checks are not atomic; unknown writes are never retried automatically |
42
+ | GitHub environment secret sync and name-presence verification | GitHub cannot return stored values; production writes are denied by the default policy |
43
+ | Restricted agent SSH access and a Linux installer | Use a separate agent account for an enforced boundary; human entry over SSH and tmux remain untested |
44
+
45
+ secretops is not a vault. The vault remains the source of truth. secretops uses external vaults and targets through narrow adapters, and it works with secret names, environments, plan artifacts, policy decisions, approvals, audit events, and safe status messages.
46
+
47
+ secretops must never print secret values or persist them in plans, audit, or logs. Values are intentionally stored in the vault and approved targets; provider-required temporary files stay broker-private and are removed after use.
48
+
49
+ ## Installation
50
+
51
+ To run secretops as a local broker for a coding agent on Linux, follow [docs/INSTALL.md](docs/INSTALL.md): `scripts/install.sh` creates the broker account, the restricted agent SSH access and the human tools, and `secretops-configure` stores the vault token at a hidden prompt. Daily use, failures, token renewal, upgrade, backup and uninstall are in [docs/OPERATIONS.md](docs/OPERATIONS.md).
52
+
53
+ Agents use the installed broker through `secretops-local`, never a source checkout of secretops or its credentials. [docs/BROKER_HOST.md](docs/BROKER_HOST.md) explains the deployment model and other variants (remote broker host, ephemeral broker); [docs/AGENT_USAGE.md](docs/AGENT_USAGE.md) explains the agent operating model and the consumer-project instructions.
54
+
55
+ For development, `uv run secretops ...` in this repository uses the configuration described below.
56
+
57
+ ## Demo: enter once, sync through an approved plan
58
+
59
+ After completing [installation and authentication](docs/INSTALL.md), use a test Infisical project and a test GitHub repository with a `dev` environment. The commands below are for the installed local broker. Enter a made-up, single-line value for this demo; never give it to the agent. Run commands one at a time and stop on any failure; exit 3 means the agent must ask the human to resolve an unknown write outcome before continuing.
60
+
61
+ **Human, in your own terminal:**
62
+
63
+ ```sh
64
+ secretops add DEMO_API_KEY --env dev
65
+ # Your sudo password may be asked first, then the hidden value and Save? [y/N]
66
+ # Saved and verified.
67
+ ```
68
+
69
+ **Agent:** create two metadata-only recipes in a temporary directory; no secretops checkout is needed. Set `owner` and `repo` below to the test repository's owner and name before running the block. Keep this agent shell open for the remaining commands:
70
+
71
+ ```sh
72
+ demo_dir=$(mktemp -d)
73
+ owner=example-owner repo=example-repo
74
+ cat > "$demo_dir/demo-sync.yaml" <<YAML
75
+ action: github.env_secret.sync_many
76
+ env: dev
77
+ github_owner: $owner
78
+ github_repo: $repo
79
+ github_environment: dev
80
+ secrets:
81
+ - source: DEMO_API_KEY
82
+ target: DEMO_API_KEY
83
+ YAML
84
+ cat > "$demo_dir/demo-verify.yaml" <<YAML
85
+ action: github.env_secret.verify_many
86
+ github_owner: $owner
87
+ github_repo: $repo
88
+ github_environment: dev
89
+ secrets:
90
+ - name: DEMO_API_KEY
91
+ YAML
92
+ ```
93
+
94
+ Upload the sync recipe and prepare its plan:
95
+
96
+ ```sh
97
+ secretops-local write-recipe demo-sync.yaml < "$demo_dir/demo-sync.yaml"
98
+ secretops-local plan --file demo-sync.yaml --save
99
+ secretops-local show-plan --id SYNC_PLAN_ID
100
+ secretops-local preflight-plan --id SYNC_PLAN_ID
101
+ ```
102
+
103
+ Replace `SYNC_PLAN_ID` with the ID returned by `plan`. If preflight fails, stop and tell the human. The agent cannot approve its own plan.
104
+
105
+ **Human:** review the source, destination, GitHub repository and environment, then approve through your own broker access:
106
+
107
+ ```sh
108
+ sudo -u secretops-broker /usr/local/bin/secretops-broker show-plan --id SYNC_PLAN_ID
109
+ sudo -u secretops-broker /usr/local/bin/secretops-broker approve-plan --id SYNC_PLAN_ID
110
+ ```
111
+
112
+ **Agent:** after approval, execute the sync and prepare a separate metadata-only verification plan:
113
+
114
+ ```sh
115
+ secretops-local execute-plan --id SYNC_PLAN_ID
116
+ # OK GitHub writes acknowledged: 1
117
+ secretops-local write-recipe demo-verify.yaml < "$demo_dir/demo-verify.yaml"
118
+ secretops-local plan --file demo-verify.yaml --save
119
+ secretops-local preflight-plan --id VERIFY_PLAN_ID
120
+ secretops-local execute-plan --id VERIFY_PLAN_ID
121
+ # present names: DEMO_API_KEY
122
+ ```
123
+
124
+ Replace `VERIFY_PLAN_ID` with the second plan's ID. Verification needs no approval under the default policy and confirms only that the name exists, not value equality. The human deletes the demo secrets from Infisical and GitHub when finished. See [OPERATIONS.md](docs/OPERATIONS.md) for failure handling and daily use.
125
+
126
+ ## Security model
127
+
128
+ secretops protects secret values in three layers:
129
+
130
+ 1. **secretops never reveals values.** Output, plans, and audit logs carry names only, and values travel through stdin or `0600` temporary files, never command-line arguments.
131
+ 2. **Operating rules for agents.** Agent instructions and policy define what an agent may run. Without privilege separation, these rules are convention.
132
+ 3. **Privilege separation.** In the broker host model, a dedicated broker user holds the vault credentials and plan store, and the agent reaches secretops only through an SSH forced-command allowlist. This is the only layer that enforces the agent boundary.
133
+
134
+ Running an agent under the same user that holds vault credentials gives you a workflow gate, not a security boundary. See `docs/SECURITY_MODEL.md` for what is enforced in each deployment, the threat table, and residual risks.
135
+
136
+ ## Vault configuration
137
+
138
+ Every operation that contacts Infisical needs explicit machine authentication and an explicit location. Saving a plan for a vault action needs the location (`SECRETOPS_INFISICAL_PROJECT_ID`, `SECRETOPS_INFISICAL_PATH`, and optionally `INFISICAL_DOMAIN`) but no token and no provider call. `show-plan` and GitHub-only operations need neither.
139
+
140
+ | Variable | Required | Meaning |
141
+ | --- | --- | --- |
142
+ | `INFISICAL_TOKEN` | yes | machine identity or service token; no user session is used |
143
+ | `SECRETOPS_INFISICAL_PROJECT_ID` | yes | Infisical project to read and write |
144
+ | `SECRETOPS_INFISICAL_PATH` | yes | absolute folder path inside the project, for example `/` |
145
+ | `INFISICAL_DOMAIN` | no | Infisical instance, default `https://eu.infisical.com` |
146
+ | `SECRETOPS_INFISICAL_BIN` | no | absolute path to the `infisical` executable; otherwise only `/usr/local/bin`, `/usr/bin`, and `/bin` are searched, never the caller's `PATH` |
147
+ | `SECRETOPS_PROVIDER_TIMEOUT_SECONDS` | no | timeout for each Infisical and GitHub CLI call, default 60 |
148
+
149
+ Breaking change: secretops no longer uses `infisical login` sessions, `.infisical.json` in the working directory, secret imports, personal overrides, or secret reference expansion. Secret names that the Infisical CLI reserves (such as `PATH` or `HOME`) or that secretops passes to the provider (`INFISICAL_*`, `SECRETOPS_*`, `PYTHON*`, `LD_*`) are rejected. The Infisical CLI cannot store empty or whitespace-only values, so such writes are refused before the CLI runs. Details are in `docs/design/infisical-adapter-hardening.md`.
150
+
151
+ Breaking change: plans are bound to their destination. A saved plan records `contract_version`, the vault destination (backend, canonical domain, project, path), and for GitHub actions the GitHub host (recipe field `github_host`, default `github.com`). `approve-plan` stores a digest of the operation content. Preflight and execution refuse a plan whose content changed after approval or whose vault destination differs from the current configuration, before any provider call. Plans saved by earlier versions can still be shown, but must be planned and approved again. Details are in `docs/design/plan-destination-binding.md`.
152
+
153
+ ## GitHub configuration
154
+
155
+ GitHub workflows require `gh` and a stored CLI login for the executing broker user. A human configures that login; agents use only the restricted broker interface. See [GitHub authentication and migration instructions](docs/BROKER_HOST.md#github-authentication-human-only).
156
+
157
+ **Breaking change:** `GH_TOKEN`, `GITHUB_TOKEN`, `GH_ENTERPRISE_TOKEN`, and `GITHUB_ENTERPRISE_TOKEN` are no longer forwarded, including tokens set in `broker.env`. Token-only installations must migrate to a stored broker-user login. The GitHub child process receives an explicit environment allowlist; unrelated credentials such as `INFISICAL_TOKEN` are excluded.
158
+
159
+ The executable is resolved through `/usr/local/bin:/usr/bin:/bin`, never the caller's `PATH`. For another location, set `SECRETOPS_GH_BIN` to an absolute executable path in trusted `broker.env`. Upgrade both the application and `/usr/local/bin/secretops-broker` from the same version; the wrapper clears inherited executable overrides. Keep the executable and its directory outside agent/broker-user write access.
160
+
161
+ ## Current proven workflows
162
+
163
+ The current MVP has proven these workflows with dummy dev/staging smoke tests. Production execution for write, sync, generate, rotate, copy, and import-file workflows is intentionally blocked by policy until production-specific controls are expanded:
164
+
165
+ - `vault.secret.generate`
166
+ - create-only by default
167
+ - generates a new secret value only during approved execution
168
+ - refuses to overwrite an existing vault secret
169
+
170
+ - `vault.secret.rotate`
171
+ - explicit replace-existing action
172
+ - requires the target secret to already exist
173
+ - rotates only in the vault
174
+ - does not automatically sync to GitHub or any target
175
+
176
+ - `vault.secret.copy_many`
177
+ - copies explicit existing vault secret mappings between vault environments
178
+ - proven with BACKUP_* dummy/test names from Infisical `dev` to Infisical `staging`
179
+ - writes through the safe vault adapter temporary-file path
180
+
181
+ - `vault.secret.diff_envs`
182
+ - compares expected secret names between two vault environments
183
+ - governance/existence check only; does not read or print secret values
184
+ - allowed for dev, staging, and production because it checks metadata only
185
+
186
+ - `github.env_secret.write`
187
+ - syncs one existing vault secret to a GitHub environment secret
188
+ - uses the GitHub CLI target adapter safely
189
+
190
+ - `github.env_secret.sync_many`
191
+ - syncs multiple existing vault secrets to GitHub environment secrets
192
+ - each source/target mapping is explicit
193
+ - proven with BACKUP_* dummy/test names from Infisical `staging` to GitHub `staging`
194
+
195
+ - `github.env_secret.verify_many`
196
+ - verifies expected GitHub environment secret names only
197
+ - does not read or print secret values
198
+ - replaces direct agent use of `gh secret list`
199
+ - proven against GitHub environment `staging` in a private test repository for the BACKUP_* names
200
+
201
+ The BACKUP_* staging smoke proof used dummy/test values and these secret names only: `BACKUP_AWS_ACCESS_KEY_ID`, `BACKUP_AWS_SECRET_ACCESS_KEY`, `BACKUP_S3_BUCKET`, and `BACKUP_AWS_REGION`. `vault.secret.copy_many` copied the names from Infisical `dev` to Infisical `staging`, then `github.env_secret.sync_many` synced the same names from Infisical `staging` to GitHub environment `staging`. `execute-plan` updated 4 GitHub staging environment secrets. A follow-up `github.env_secret.verify_many` smoke proof confirmed all four expected GitHub environment secret names were present in that repository's `staging` environment, using GitHub only indirectly through `secretops execute-plan`. No secret values were read or printed during verification, and no GitHub secrets were updated. A negative production-denial smoke proof also confirmed that approved `github.env_secret.sync_many` execution for GitHub environment `production` fails safely with `FAIL production execution denied by policy: github.env_secret.sync_many`, leaves `api_call_made: False`, marks the plan `failed`, and blocks before provider calls. Production sync remains future work.
202
+
203
+ The basic read-only check action is also supported:
204
+
205
+ - `vault.read.check`
206
+
207
+ ## Adding a secret you already have
208
+
209
+ `secretops add` stores one new secret whose value a human has, for example an API key created in a provider console. Direct and agent-prepared entry have passed live validation through the local sudo broker. Human submission over SSH and use inside tmux remain untested; see the [validation record](docs/validation/interactive-secret-entry.md).
210
+
211
+ After [one-time client and broker setup](docs/BROKER_HOST.md#human-secret-entry), choose either interactive metadata entry, a named secret, or an agent-prepared plan:
212
+
213
+ ```bash
214
+ secretops add
215
+ secretops add SCALEWAY_API_KEY --env dev
216
+ secretops add --plan PLAN_ID
217
+ ```
218
+
219
+ Use `--broker NAME` to select a configured broker. The first form asks for the name and environment; all three show the broker's destination before hidden value entry and confirmation. When running from a source checkout, prefix these commands with `uv run`.
220
+
221
+ Type or paste one nonblank line, at most 16 KiB in UTF-8, into the hidden prompt. Multiline values are rejected; empty/whitespace-only values and control characters are not supported. Values cannot be supplied as command arguments, environment variables, files, or raw stdin to `add`. Existing names are refused at the final check; this command does not rotate or replace them. Creating a provider API key and syncing the stored value to GitHub are separate operations.
222
+
223
+ ```text
224
+ $ secretops add SCALEWAY_API_KEY --env staging
225
+ ...
226
+ Value (hidden):
227
+ Save? [y/N]: y
228
+
229
+ Saved and verified.
230
+ ```
231
+
232
+ The broker shows the destination and checks that the name is absent before asking for the value; the value is entered without echo, sent once over the human's own broker access (SSH or sudo), and confirmed by read-back. When an agent has prepared the plan, the human runs `secretops add --plan <plan_id>`. The agent key cannot do this step. With Infisical, create-only is a check followed by a write, not an atomic create. Setup and limits: [Human secret entry](docs/BROKER_HOST.md#human-secret-entry).
233
+
234
+ ## Standard safety flow
235
+
236
+ For deployed agents, use the restricted broker connection configured by a human. Replace `BROKER_ALIAS` with its SSH alias; the local recipe contains names and metadata only:
237
+
238
+ ```bash
239
+ ssh BROKER_ALIAS write-recipe task.yaml < task.yaml
240
+ ssh BROKER_ALIAS plan --file task.yaml --save
241
+ ssh BROKER_ALIAS show-plan --id <plan_id>
242
+ ssh BROKER_ALIAS preflight-plan --id <plan_id>
243
+ # Wait for human approval through separate access.
244
+ ssh BROKER_ALIAS execute-plan --id <plan_id>
245
+ ```
246
+
247
+ The agent cannot approve or reject plans. See [the broker operating flow](docs/BROKER_HOST.md#operating-flow) for human approval commands and [agent instructions](docs/AGENT_USAGE.md#instructions-for-agents-in-consumer-projects) for the consumer-project template.
248
+
249
+ The following commands are for a human operating from a development checkout with their own configured identity. They do not establish an agent security boundary:
250
+
251
+ ```bash
252
+ uv run secretops plan --file examples/recipes/vault-secret-generate.yaml --save
253
+ uv run secretops show-plan --id <plan_id>
254
+ uv run secretops preflight-plan --id <plan_id>
255
+ uv run secretops approve-plan --id <plan_id>
256
+ uv run secretops execute-plan --id <plan_id>
257
+ ```
258
+
259
+ The normal lifecycle is:
260
+
261
+ ```text
262
+ plan --save -> show-plan -> preflight-plan -> approve-plan -> execute-plan
263
+ ```
264
+
265
+ `show-plan` prints curated safe metadata, not raw JSON, including the vault destination, the GitHub host, and `plan_digest`. Approval covers the content loaded at approval time: `approve-plan` records its digest, and later content changes or a different configured vault destination stop the plan before any provider call. There is currently no `--digest` confirmation tying approval to an earlier `show-plan` view; the human must review the current plan and keep the plan store protected.
266
+
267
+ `preflight-plan` checks safe prerequisites before execution. For example:
268
+
269
+ - generate checks that the target secret is missing
270
+ - rotate checks that the target secret exists
271
+ - copy_many checks source and target vault environments before copying
272
+ - diff_envs compares expected names in two vault environments without reading values
273
+ - GitHub sync checks source secret existence without printing values
274
+ - GitHub verify_many checks configured expected names without provider calls during preflight
275
+
276
+ `execute-plan` performs the operation only through the configured adapter path.
277
+
278
+ ## Dummy/dev examples
279
+
280
+ These are human-operated development-checkout examples using the configuration above. Installed deployments use the installed CLI; agents use the SSH flow above.
281
+
282
+ Generate a dummy secret in Infisical dev:
283
+
284
+ ```bash
285
+ uv run secretops plan --file examples/recipes/vault-secret-generate.yaml --save
286
+ uv run secretops show-plan --id <plan_id>
287
+ uv run secretops preflight-plan --id <plan_id>
288
+ uv run secretops approve-plan --id <plan_id>
289
+ uv run secretops execute-plan --id <plan_id>
290
+ ```
291
+
292
+ Rotate the same dummy secret in Infisical dev:
293
+
294
+ ```bash
295
+ uv run secretops plan --file examples/recipes/vault-secret-rotate.yaml --save
296
+ uv run secretops show-plan --id <plan_id>
297
+ uv run secretops preflight-plan --id <plan_id>
298
+ uv run secretops approve-plan --id <plan_id>
299
+ uv run secretops execute-plan --id <plan_id>
300
+ ```
301
+
302
+ Sync an existing dummy vault secret to GitHub environment dev:
303
+
304
+ ```yaml
305
+ action: github.env_secret.sync_many
306
+ env: dev
307
+ github_host: github.com
308
+ github_owner: example-owner
309
+ github_repo: example-repo
310
+ github_environment: dev
311
+
312
+ secrets:
313
+ - source: GENERATED_DUMMY_PASSWORD
314
+ target: GENERATED_DUMMY_PASSWORD
315
+ ```
316
+
317
+ Save the YAML above as `github-sync.yaml`, replace the example owner and repository with your intended test target, and ensure GitHub authentication is configured for the executing user (see [broker setup](docs/BROKER_HOST.md#github-authentication-human-only)). Then run:
318
+
319
+ ```bash
320
+ uv run secretops plan --file github-sync.yaml --save
321
+ uv run secretops show-plan --id <plan_id>
322
+ uv run secretops preflight-plan --id <plan_id>
323
+ uv run secretops approve-plan --id <plan_id>
324
+ uv run secretops execute-plan --id <plan_id>
325
+ ```
326
+
327
+ ## Safety invariants
328
+
329
+ These invariants are part of the product contract:
330
+
331
+ - never print secret values
332
+ - never write secret values into plan artifacts
333
+ - never write secret values into audit logs
334
+ - never pass secret values through command-line arguments
335
+ - use safe transfer paths:
336
+ - stdin for GitHub target writes
337
+ - temporary files with restrictive permissions for Infisical writes
338
+ - run the Infisical CLI with an explicit environment, never the broker's own, so local variables, user sessions, and working-directory config cannot affect answers
339
+ - treat a vault error as an error, never as "secret missing"
340
+ - run a saved plan only against the destination it records: the vault destination must match the configuration, GitHub calls use the planned host, and an approved plan must match its approval digest
341
+ - report an Infisical vault write as successful only after a read-back confirms it; an unconfirmed vault write is reported as an unknown outcome and never retried automatically. GitHub target writes still rely on the `gh` exit status
342
+ - planning must not generate secret values
343
+ - preflight must not generate or write secret values
344
+ - secret names may be printed when needed
345
+ - secret values must not be printed in stdout, stderr, audit logs, plan files, docs, test output, or error messages
346
+
347
+ ## Current limitations and tested versions
348
+
349
+ - Infisical create-only checks existence and writes in separate calls. It refuses an existing secret when observed, but cannot guarantee atomic create-only behavior against a concurrent writer. Keep other writers coordinated; plan destination binding does not add conditional writes.
350
+ - GitHub calls have per-call timeouts and explicit acknowledged/unknown write outcomes, with partial-sync reporting. Acknowledgement relies on the CLI exit status; GitHub does not provide secret-value read-back, and name presence cannot resolve an unknown write.
351
+ - Human interactive entry is available through `secretops add`; the complete local-sudo entry-to-GitHub workflow has been validated. Human entry over SSH and use inside tmux remain untested, and the exact local terminal emulator identity/version remains unconfirmed. The separate `vault.secret.import_file` workflow remains available for human-provisioned broker-private files.
352
+ - One broker per machine, and one Infisical server, project and folder per broker. The human sets this destination; recipes cannot choose it. With one Infisical project per application, switch with `sudo secretops-configure` (open plans for the old destination then need a new plan). Several named destinations per broker are the next planned feature; see [TODO.md](TODO.md).
353
+ - Tested: Infisical CLI `0.43.99`, self-hosted server `0.161.10`; GitHub CLI `2.4.0+dfsg1` for host-qualified metadata verification and a human-approved synthetic secret write with the isolated environment. A separate metadata check confirmed the test name; the value was not read back. These are tested versions, not a compatibility guarantee for every version.
354
+
355
+ See [Infisical acceptance results](docs/design/infisical-adapter-hardening.md) and [destination-binding validation](docs/design/plan-destination-binding.md#manual-validation-result--2026-10-18). See also [GitHub environment-isolation validation](docs/validation/github-environment-isolation.md), [interactive entry validation](docs/validation/interactive-secret-entry.md), and [the complete entry-to-GitHub validation](docs/validation/github-target-reliability.md) for live results and their evidence limits. Installation and daily operation: [docs/INSTALL.md](docs/INSTALL.md) and [docs/OPERATIONS.md](docs/OPERATIONS.md), validated on a clean VM ([results and limits](docs/validation/local-broker-installation.md)).
356
+
357
+ PR numbers and commit hashes in historical design and validation records refer to private development history before v0.1 and may not be accessible from this public repository.
358
+
359
+ ## Current adapters
360
+
361
+ - Infisical CLI vault adapter
362
+ - GitHub CLI environment secret target adapter
363
+
364
+ secretops invokes these adapters only through narrow code paths that suppress provider stdout/stderr and avoid exposing values.
365
+
366
+ ## Tests
367
+
368
+ Run the test suite with:
369
+
370
+ ```bash
371
+ uv run pytest
372
+ ```
373
+
374
+ The tests include safety assertions that dummy secret values never appear in CLI output, audit logs, plan artifacts, or command-line arguments.
375
+
376
+ ## CI
377
+
378
+ GitHub Actions CI runs local fake-provider tests only:
379
+
380
+ ```bash
381
+ uv sync --all-extras --dev
382
+ uv run pytest
383
+ sh tests/test_broker_wrappers.sh
384
+ ```
385
+
386
+ CI does not require repository secrets, provider credentials, real Infisical access, or real GitHub secret access.
387
+
388
+ ## Security and license
389
+
390
+ Report vulnerabilities privately; see [SECURITY.md](SECURITY.md). secretops is licensed under the [Apache License 2.0](LICENSE).