crebro 0.0.1 → 0.1.0-darwin-x64

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.
package/README.md CHANGED
@@ -1,5 +1,241 @@
1
- # Crebro
1
+ # Crebro - Credential Broker
2
2
 
3
- This is a placeholder reservation release for the Crebro npm package name.
3
+ Crebro is a local credential broker for coding agents that keeps secrets out of external LLM requests.
4
4
 
5
- It does not include the Crebro CLI binary. Install a later non-placeholder version when the npm CLI distribution is published.
5
+ ## What It Does
6
+
7
+ Credentials should stay local. Crebro's position is that API keys, tokens, passwords, and manually marked secrets should not be sent to an external LLM just because they appeared in a prompt, config file, environment variable, or tool context.
8
+
9
+ Crebro runs as a one-shot wrapper around a child agent process:
10
+
11
+ ```sh
12
+ crebro -- codex
13
+ ```
14
+
15
+ It starts a loopback gateway or local proxy, launches the child command, routes supported provider traffic through Crebro, redacts discovered secrets before the request reaches the upstream LLM provider, and restores Crebro placeholders in the local response stream before the child agent sees the answer.
16
+
17
+ The current implementation focuses on:
18
+
19
+ - zero-config first
20
+ - in-memory secret handling
21
+ - no persistent secret storage
22
+ - environment and `.env` credential discovery
23
+ - exact-match redaction for managed secrets
24
+ - user-declared secrets with `<cb>...</cb>`
25
+ - placeholder restoration in responses
26
+
27
+ ## What It Does Not Do
28
+
29
+ Crebro is not a full security boundary.
30
+
31
+ - It does not protect against privileged memory inspection, kernel-level attackers, malicious local processes, or secrets that already exist in your shell, files, terminal, or child agent process.
32
+ - It does not provide semantic detection for every possible secret-like value. current targets exact-match redaction of known, discovered, or explicitly declared secrets.
33
+ - It does not install system-wide trust. Proxy mode uses a session-local CA for the wrapped child process.
34
+ - It does not claim full provider certification yet.
35
+ - It does not replace normal secret hygiene, provider-side access controls, or outbound network monitoring.
36
+
37
+ ## Test
38
+
39
+ Crebro is intended to protect coding-agent traffic broadly. The first tested scope is Codex.
40
+
41
+ Verified local routing surfaces:
42
+
43
+ - Codex CLI 0.133.0 using OpenAI-compatible routing through `OPENAI_BASE_URL`
44
+ - Codex ChatGPT auth traffic through child-scoped proxy environment variables and `chatgpt.com/backend-api`
45
+
46
+ Manual Wireshark QA was also run with Crebro TLS key logging enabled. The capture was decrypted in Wireshark to inspect the outbound provider payload during a real Codex session.
47
+
48
+ Evidence from that run is included below.
49
+
50
+ | Evidence | Screenshot |
51
+ | --- | --- |
52
+ | Codex session routed through Crebro | ![Codex session routed through Crebro](docs/codex-chat.png) |
53
+ | Wireshark payload inspection | ![Wireshark payload inspection](docs/wireshark-payload-log.png) |
54
+
55
+ ## Install
56
+
57
+ ### Requirements
58
+
59
+ - Rust toolchain with Rust 2024 edition support
60
+ - A supported child agent command, such as `codex`
61
+
62
+ ### Install From crates.io
63
+
64
+ ```sh
65
+ cargo install crebro
66
+ ```
67
+
68
+ ### Install From npm
69
+
70
+ ```sh
71
+ npm install -g crebro
72
+ ```
73
+
74
+ ### Install From Source
75
+
76
+ ```sh
77
+ git clone https://github.com/syi0808/crebro.git
78
+ cd crebro
79
+ cargo install --path .
80
+ ```
81
+
82
+ ### Verify
83
+
84
+ ```sh
85
+ crebro --version
86
+ crebro --help
87
+ ```
88
+
89
+ ## Usage
90
+
91
+ ### Basic Codex Wrapper
92
+
93
+ ```sh
94
+ crebro -- codex
95
+ ```
96
+
97
+ Crebro launches `codex`, removes raw provider keys from the child environment, sets provider base URL variables to the local Crebro gateway, and exits with the child process status.
98
+
99
+ ### Automatic Routing Choice
100
+
101
+ ```sh
102
+ crebro -- codex
103
+ ```
104
+
105
+ Crebro does not ask the user to choose a routing mode. It uses the native provider gateway path when the child command can be routed through provider base URL variables. When Codex is running through ChatGPT auth and there is no provider API key, Crebro uses a child-scoped local proxy because that traffic does not honor `OPENAI_BASE_URL`.
106
+
107
+ The proxy path starts a local explicit proxy, injects proxy environment variables into the child process, and uses a session-local CA for allowlisted MITM traffic. This is an implementation detail driven by the agent's auth path, not a feature toggle the user is expected to manage.
108
+
109
+ ### Upstream URL
110
+
111
+ Crebro infers the default upstream URL for supported commands. Override it when needed:
112
+
113
+ ```sh
114
+ crebro --upstream-url https://api.openai.com -- codex
115
+ ```
116
+
117
+ or:
118
+
119
+ ```sh
120
+ CREBRO_UPSTREAM_URL=https://api.openai.com crebro -- codex
121
+ ```
122
+
123
+ ### Provider API Key
124
+
125
+ Crebro can read provider keys from the environment or from `--provider-api-key`.
126
+
127
+ ```sh
128
+ CREBRO_PROVIDER_API_KEY=sk-example crebro -- codex
129
+ ```
130
+
131
+ Known provider key variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `GEMINI_API_KEY`, `GOOGLE_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY`, and `OPENCODE_API_KEY`.
132
+
133
+ ### Environment File
134
+
135
+ By default, Crebro checks `.env` for credential candidates.
136
+
137
+ ```sh
138
+ crebro --env-file .env.local -- codex
139
+ ```
140
+
141
+ or:
142
+
143
+ ```sh
144
+ CREBRO_ENV_FILE=.env.local crebro -- codex
145
+ ```
146
+
147
+ ### User-Declared Secrets
148
+
149
+ If automatic discovery cannot know that a prompt fragment is sensitive, wrap it with `<cb>...</cb>` inside the agent prompt:
150
+
151
+ ```text
152
+ Use <cb>my-manual-secret</cb> for this local step.
153
+ ```
154
+
155
+ Crebro consumes the tags locally, registers the inner value as an encrypted in-memory secret capsule, and forwards only a Crebro placeholder upstream.
156
+
157
+ ### Placeholder Guidance
158
+
159
+ When Crebro redacts a request, it can add a short instruction asking the LLM to reuse `{{CREBRO_SECRET:...}}` placeholders verbatim in commands, code, config, and shell snippets. The default instruction text is compiled from `prompts/placeholder-guidance.md`.
160
+
161
+ Disable this behavior with:
162
+
163
+ ```sh
164
+ crebro --no-placeholder-guidance -- codex
165
+ ```
166
+
167
+ or:
168
+
169
+ ```sh
170
+ CREBRO_NO_PLACEHOLDER_GUIDANCE=true crebro -- codex
171
+ ```
172
+
173
+ Redaction still runs when placeholder guidance is disabled.
174
+
175
+ ### Credential Pattern Rules
176
+
177
+ Built-in discovery and detector rules live in `patterns/credentials.toml` and are compiled into the binary.
178
+
179
+ Use a custom rule file with:
180
+
181
+ ```sh
182
+ crebro --patterns-file ./patterns/credentials.toml -- codex
183
+ ```
184
+
185
+ or:
186
+
187
+ ```sh
188
+ CREBRO_PATTERNS_FILE=./patterns/credentials.toml crebro -- codex
189
+ ```
190
+
191
+ Rules can reject unregistered credential-looking values, allow intentionally public identifiers, or auto-redact specific patterns.
192
+
193
+ ### Local Stats
194
+
195
+ When launched through the CLI, Crebro writes best-effort local stats to `~/.crebro/stats.json`.
196
+
197
+ ```sh
198
+ crebro --stats-dir /tmp/crebro-stats -- codex
199
+ ```
200
+
201
+ or:
202
+
203
+ ```sh
204
+ CREBRO_STATS_DIR=/tmp/crebro-stats crebro -- codex
205
+ ```
206
+
207
+ The stats file stores counts by Crebro placeholder id and credential pattern id. It does not store raw secrets, raw prompts, or raw responses.
208
+
209
+ ### TLS Key Logging For QA
210
+
211
+ For isolated QA sessions, Crebro can write TLS key logs for its upstream HTTPS connections:
212
+
213
+ ```sh
214
+ CREBRO_TLS_KEYLOG_FILE=/tmp/crebro-tls.keys crebro -- codex
215
+ ```
216
+
217
+ or:
218
+
219
+ ```sh
220
+ crebro --tls-keylog-file /tmp/crebro-tls.keys -- codex
221
+ ```
222
+
223
+ Use this only in controlled testing. Delete the key log file after analysis.
224
+
225
+ ## Frequently Asked Questions
226
+
227
+ ### Can Crebro guarantee that no secret ever leaves my machine?
228
+
229
+ No. Crebro redacts known, discovered, or explicitly declared secrets before the upstream LLM request. It cannot protect against secrets already exposed to the child process, secrets not registered with Crebro, privileged local inspection, OS-level compromise, or an agent that sends data outside the routed path.
230
+
231
+ ### Does proxy mode decrypt my traffic?
232
+
233
+ For allowlisted proxy targets, yes. Proxy mode uses local MITM so Crebro can redact request bodies and restore placeholders in responses. The CA is session-local and injected into the wrapped child process; Crebro does not install system-wide trust.
234
+
235
+ ### How was Crebro built?
236
+
237
+ The product direction, architecture decisions, and real testing were done by a human. The implementation was vibe-coded with AI assistance and then checked against local tests and manual review.
238
+
239
+ ## License
240
+
241
+ Crebro is licensed under the [Apache License 2.0](LICENSE).
package/package.json CHANGED
@@ -1,16 +1,24 @@
1
1
  {
2
2
  "name": "crebro",
3
- "version": "0.0.1",
4
- "description": "Reserved placeholder package for the Crebro CLI npm distribution.",
3
+ "version": "0.1.0-darwin-x64",
4
+ "description": "Local credential broker for coding agents that redacts secrets before LLM provider requests. Native binary for darwin-x64.",
5
5
  "license": "Apache-2.0",
6
+ "os": [
7
+ "darwin"
8
+ ],
9
+ "cpu": [
10
+ "x64"
11
+ ],
6
12
  "files": [
7
- "README.md",
8
- "LICENSE"
13
+ "vendor"
9
14
  ],
10
15
  "repository": {
11
16
  "type": "git",
12
17
  "url": "git+https://github.com/syi0808/crebro.git"
13
18
  },
19
+ "engines": {
20
+ "node": ">=16"
21
+ },
14
22
  "keywords": [
15
23
  "credentials",
16
24
  "proxy",