agentsecrets-cli 1.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.
- agentsecrets_cli-1.1.0/.gitignore +72 -0
- agentsecrets_cli-1.1.0/PKG-INFO +622 -0
- agentsecrets_cli-1.1.0/README.md +607 -0
- agentsecrets_cli-1.1.0/pyproject.toml +36 -0
- agentsecrets_cli-1.1.0/src/agentsecrets/__init__.py +1 -0
- agentsecrets_cli-1.1.0/src/agentsecrets/binary.py +145 -0
- agentsecrets_cli-1.1.0/src/agentsecrets/main.py +24 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Binaries for programs and plugins
|
|
2
|
+
*.exe
|
|
3
|
+
*.exe~
|
|
4
|
+
*.dll
|
|
5
|
+
*.so
|
|
6
|
+
*.dylib
|
|
7
|
+
/agentsecrets
|
|
8
|
+
/agentsecrets-*
|
|
9
|
+
|
|
10
|
+
# Test binary, built with `go test -c`
|
|
11
|
+
*.test
|
|
12
|
+
|
|
13
|
+
# Output of the go coverage tool
|
|
14
|
+
*.out
|
|
15
|
+
coverage.txt
|
|
16
|
+
coverage.html
|
|
17
|
+
|
|
18
|
+
# Dependency directories
|
|
19
|
+
vendor/
|
|
20
|
+
|
|
21
|
+
# Go workspace file
|
|
22
|
+
go.work
|
|
23
|
+
|
|
24
|
+
# Environment files (never commit secrets!)
|
|
25
|
+
.env
|
|
26
|
+
.env.*
|
|
27
|
+
*.env
|
|
28
|
+
|
|
29
|
+
# IDE files
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
|
|
36
|
+
# OS files
|
|
37
|
+
.DS_Store
|
|
38
|
+
Thumbs.db
|
|
39
|
+
|
|
40
|
+
# Config files (local only)
|
|
41
|
+
.agentsecrets/
|
|
42
|
+
config.json
|
|
43
|
+
|
|
44
|
+
# Build artifacts
|
|
45
|
+
dist/
|
|
46
|
+
build/
|
|
47
|
+
bin/
|
|
48
|
+
*.egg-info/
|
|
49
|
+
node_modules/
|
|
50
|
+
.npm/
|
|
51
|
+
env/
|
|
52
|
+
venv/
|
|
53
|
+
__pycache__/
|
|
54
|
+
*.pyc
|
|
55
|
+
.pytest_cache/
|
|
56
|
+
|
|
57
|
+
# Temporary files
|
|
58
|
+
tmp/
|
|
59
|
+
temp/
|
|
60
|
+
*.tmp
|
|
61
|
+
|
|
62
|
+
# Log files
|
|
63
|
+
*.log
|
|
64
|
+
|
|
65
|
+
knowledge_base
|
|
66
|
+
knowledge_base.md
|
|
67
|
+
PROJECT_SETUP_SUMMARY.md
|
|
68
|
+
docs/API_SPECIFICATION.md
|
|
69
|
+
docs/learning/
|
|
70
|
+
proxy_spec.md
|
|
71
|
+
code_review.md
|
|
72
|
+
content/
|
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentsecrets-cli
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: AI-native zero-knowledge secrets manager
|
|
5
|
+
Author-email: The Seventeen <hello@theseventeen.co>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: agents,ai,cli,credentials,secrets,security
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Security
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# AgentSecrets
|
|
17
|
+
|
|
18
|
+
> **Zero-knowledge secrets infrastructure built for AI agents to operate, not just consume.**
|
|
19
|
+
|
|
20
|
+
Every other secrets tool was built for humans to provision credentials to agents. AgentSecrets was built for agents to manage credentials themselves — without ever seeing a single value.
|
|
21
|
+
|
|
22
|
+
[](https://opensource.org/licenses/MIT)
|
|
23
|
+
[](https://go.dev/)
|
|
24
|
+
[](https://clawhub.ai/SteppaCodes/agentsecrets)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
> **Package rename notice**
|
|
29
|
+
> The `agentsecrets` PyPI package is now the [AgentSecrets SDK](https://github.com/The-17/agentsecrets-sdk) — for developers building tools and agents on AgentSecrets infrastructure.
|
|
30
|
+
> This CLI wrapper is now `agentsecrets-cli`.
|
|
31
|
+
> If you previously installed `pip install agentsecrets` for CLI access, run:
|
|
32
|
+
> ```bash
|
|
33
|
+
> pip install agentsecrets-cli
|
|
34
|
+
> ```
|
|
35
|
+
> The `agentsecrets` CLI command itself is unchanged. Only the PyPI package name changed.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## What This Is
|
|
40
|
+
|
|
41
|
+
Most secrets tools treat AI agents as consumers — something that receives a credential and uses it. AgentSecrets treats the agent as an operator.
|
|
42
|
+
|
|
43
|
+
Your agent checks its own status. Notices a secret is out of sync. Pulls the latest from the cloud. Makes the authenticated API call. Audits what it did. All of this without ever knowing a single credential value.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# An AI agent managing its own secrets workflow autonomously
|
|
47
|
+
|
|
48
|
+
agentsecrets status # what workspace, project, last sync?
|
|
49
|
+
agentsecrets secrets diff # anything out of sync?
|
|
50
|
+
agentsecrets secrets pull # sync from cloud to keychain
|
|
51
|
+
agentsecrets secrets list # what keys are available?
|
|
52
|
+
agentsecrets call \
|
|
53
|
+
--url https://api.stripe.com/v1/balance \
|
|
54
|
+
--bearer STRIPE_KEY # make the authenticated call
|
|
55
|
+
agentsecrets proxy logs # audit what just happened
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The agent ran the entire credentials workflow. It never saw `sk_live_51H...`. Not at any step.
|
|
59
|
+
|
|
60
|
+
This is what it means to be built for the agentic era — not bolted onto it.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## The Problem With Every Other Approach
|
|
65
|
+
|
|
66
|
+
Traditional vaults protect credentials at rest. Once an agent retrieves a key to use it, that key is in agent memory. That's where it gets vulnerable.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Vault → agent retrieves sk_live_51H... → key is in agent memory
|
|
70
|
+
→ prompt injection can reach it
|
|
71
|
+
→ malicious plugin can reach it
|
|
72
|
+
→ CVE can expose it
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
AgentSecrets never puts the value in agent memory. The proxy resolves from the OS keychain and injects at the transport layer. The agent makes the call. It sees only the response.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
AgentSecrets → agent says "use STRIPE_KEY" → proxy resolves from OS keychain
|
|
79
|
+
→ injects into HTTP request
|
|
80
|
+
→ returns API response only
|
|
81
|
+
→ value never entered agent context
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
You cannot steal what was never there.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Installation
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install agentsecrets-cli
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or install the full binary directly — recommended for production use:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Homebrew (macOS / Linux)
|
|
98
|
+
brew install the-17/tap/agentsecrets
|
|
99
|
+
|
|
100
|
+
# npm
|
|
101
|
+
npm install -g @the-17/agentsecrets
|
|
102
|
+
|
|
103
|
+
# pip
|
|
104
|
+
pip install agentsecrets-cli
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Create account + encryption keys
|
|
113
|
+
agentsecrets init
|
|
114
|
+
|
|
115
|
+
# Create a project
|
|
116
|
+
agentsecrets project create my-app
|
|
117
|
+
|
|
118
|
+
# Store credentials — values go to OS keychain, never to disk
|
|
119
|
+
agentsecrets secrets set STRIPE_KEY=sk_live_51H...
|
|
120
|
+
agentsecrets secrets set OPENAI_KEY=sk-proj-...
|
|
121
|
+
agentsecrets secrets set DATABASE_URL=postgresql://...
|
|
122
|
+
|
|
123
|
+
# Or push your existing .env all at once
|
|
124
|
+
agentsecrets secrets push
|
|
125
|
+
|
|
126
|
+
# Authorize the domains your agents can reach
|
|
127
|
+
agentsecrets workspace allowlist add api.stripe.com api.openai.com
|
|
128
|
+
|
|
129
|
+
# Connect your AI tool
|
|
130
|
+
agentsecrets mcp install # Claude Desktop + Cursor
|
|
131
|
+
agentsecrets proxy start # Any agent via HTTP
|
|
132
|
+
openclaw skill install agentsecrets # OpenClaw
|
|
133
|
+
|
|
134
|
+
# Or inject secrets as env vars into any Python process
|
|
135
|
+
agentsecrets env -- python manage.py runserver
|
|
136
|
+
agentsecrets env -- celery -A myapp worker
|
|
137
|
+
agentsecrets env -- pytest
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Your agent now has full API access. It will never see a credential value.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## The Agent Workflow
|
|
145
|
+
|
|
146
|
+
This is what AgentSecrets looks like when an AI agent is operating it end to end.
|
|
147
|
+
|
|
148
|
+
### Check status
|
|
149
|
+
```bash
|
|
150
|
+
agentsecrets status
|
|
151
|
+
# Logged in as: steppa@theseventeen.co
|
|
152
|
+
# Workspace: Acme Engineering
|
|
153
|
+
# Project: payments-service
|
|
154
|
+
# Last pull: 2 minutes ago
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Notice drift and sync
|
|
158
|
+
```bash
|
|
159
|
+
agentsecrets secrets diff
|
|
160
|
+
# LOCAL ONLY: PAYSTACK_KEY
|
|
161
|
+
# REMOTE ONLY: SENDGRID_KEY
|
|
162
|
+
# OUT OF SYNC: STRIPE_KEY (remote is newer)
|
|
163
|
+
|
|
164
|
+
agentsecrets secrets pull
|
|
165
|
+
# Synced 3 secrets from cloud to OS keychain
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Make authenticated calls
|
|
169
|
+
```bash
|
|
170
|
+
agentsecrets call --url https://api.stripe.com/v1/balance --bearer STRIPE_KEY
|
|
171
|
+
# {"object":"balance","available":[{"amount":420000,"currency":"usd"}]}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Audit what happened
|
|
175
|
+
```bash
|
|
176
|
+
agentsecrets proxy logs --last 10
|
|
177
|
+
# 14:23:01 GET api.stripe.com/v1/balance STRIPE_KEY 200 245ms
|
|
178
|
+
# 14:31:15 POST api.stripe.com/v1/charges STRIPE_KEY 200 412ms
|
|
179
|
+
# 14:31:16 POST api.openai.com/v1/chat/... OPENAI_KEY 200 1203ms
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
The agent managed the complete credentials lifecycle. No human touched the workflow. No credential value was exposed at any step.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Zero-Knowledge Architecture
|
|
187
|
+
|
|
188
|
+
AgentSecrets is zero-knowledge at every layer — not just at the point of API injection.
|
|
189
|
+
|
|
190
|
+
| Step | What the agent sees |
|
|
191
|
+
|---|---|
|
|
192
|
+
| `secrets list` | Key names only |
|
|
193
|
+
| `secrets diff` | Key names and sync status |
|
|
194
|
+
| `secrets pull` | Confirmation message — values go to OS keychain |
|
|
195
|
+
| `agentsecrets call` | API response only |
|
|
196
|
+
| `agentsecrets env` | Injects values into child process — agent never sees them |
|
|
197
|
+
| `proxy logs` | Key names, endpoints, status codes |
|
|
198
|
+
|
|
199
|
+
The log struct has no value field. It is structurally impossible to accidentally log a credential value anywhere in the system.
|
|
200
|
+
|
|
201
|
+
### Zero-Trust Proxy Enforcement
|
|
202
|
+
|
|
203
|
+
AgentSecrets enforces a **deny-by-default** security posture on every proxied request.
|
|
204
|
+
|
|
205
|
+
**Domain Allowlist:** Every outbound request must target a domain explicitly authorized in your workspace allowlist. If an agent attempts to hit an unauthorized domain, whether through prompt injection, SSRF, or misconfiguration, the proxy blocks the request with 403 Forbidden and logs the attempt.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Authorize domains (supports multiple at once)
|
|
209
|
+
agentsecrets workspace allowlist add api.stripe.com api.openai.com
|
|
210
|
+
|
|
211
|
+
# Review allowed domains
|
|
212
|
+
agentsecrets workspace allowlist list
|
|
213
|
+
|
|
214
|
+
# View blocked attempts
|
|
215
|
+
agentsecrets workspace allowlist log
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Allowlist modifications require admin role and password verification. Non-admins cannot change what domains agents can reach.
|
|
219
|
+
|
|
220
|
+
**Response Body Redaction:** If an external API echoes back the injected credential in its response body, the proxy automatically replaces the value with `[REDACTED_BY_AGENTSECRETS]` before the response reaches the agent. This prevents credential echo exfiltration — a class of attack where a malicious API is designed to reflect secrets back into agent context.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
agentsecrets proxy logs --last 5
|
|
224
|
+
# 14:23:01 ✓ OK (REDACTED) GET httpbin.org/headers STRIPE_KEY bearer 200 credential_echo 245ms
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Role Management
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
agentsecrets workspace promote user@email.com # Grant admin role
|
|
231
|
+
agentsecrets workspace demote user@email.com # Revoke admin role
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Encryption
|
|
235
|
+
| Layer | Implementation |
|
|
236
|
+
|---|---|
|
|
237
|
+
| Key exchange | X25519 (NaCl SealedBox) |
|
|
238
|
+
| Secret encryption | AES-256-GCM |
|
|
239
|
+
| Key derivation | Argon2id |
|
|
240
|
+
| Key storage | OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) |
|
|
241
|
+
| Transport | HTTPS / TLS |
|
|
242
|
+
| Server | Stores encrypted blobs only — cannot decrypt |
|
|
243
|
+
| Proxy | Session token, SSRF protection, redirect stripping |
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Team Workspaces
|
|
248
|
+
|
|
249
|
+
AgentSecrets is built for teams. A workspace is a shared environment — teammates join and get access to projects within it. Secrets are encrypted client-side before upload. The server cannot decrypt them.
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Create workspace
|
|
253
|
+
agentsecrets workspace create "Acme Engineering"
|
|
254
|
+
|
|
255
|
+
# Invite teammates
|
|
256
|
+
agentsecrets workspace invite alice@acme.com
|
|
257
|
+
agentsecrets workspace invite bob@acme.com
|
|
258
|
+
|
|
259
|
+
# Partition by service
|
|
260
|
+
agentsecrets project create payments-service
|
|
261
|
+
agentsecrets project create auth-service
|
|
262
|
+
agentsecrets project create data-pipeline
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**New developer onboards:**
|
|
266
|
+
```bash
|
|
267
|
+
agentsecrets login
|
|
268
|
+
agentsecrets workspace switch "Acme Engineering"
|
|
269
|
+
agentsecrets project use payments-service
|
|
270
|
+
agentsecrets secrets pull
|
|
271
|
+
# Ready. No credential sharing. No .env files sent over Slack.
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Every AI agent every teammate runs has access to the credentials it needs. None of them ever see the values.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## The Credential Proxy
|
|
279
|
+
|
|
280
|
+
AgentSecrets runs a local HTTP proxy on `localhost:8765`. Agents send requests with injection headers. The proxy resolves from the OS keychain, injects into the outbound request, returns only the response.
|
|
281
|
+
|
|
282
|
+
### 6 Auth Styles
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
# Bearer token (Stripe, OpenAI, GitHub, most modern APIs)
|
|
286
|
+
agentsecrets call --url https://api.stripe.com/v1/balance --bearer STRIPE_KEY
|
|
287
|
+
|
|
288
|
+
# Custom header (SendGrid, Twilio, API Gateway)
|
|
289
|
+
agentsecrets call --url https://api.sendgrid.com/v3/mail/send \
|
|
290
|
+
--header X-Api-Key=SENDGRID_KEY
|
|
291
|
+
|
|
292
|
+
# Query parameter (Google Maps, weather APIs)
|
|
293
|
+
agentsecrets call --url "https://maps.googleapis.com/maps/api/geocode/json" \
|
|
294
|
+
--query key=GMAP_KEY
|
|
295
|
+
|
|
296
|
+
# Basic auth (Jira, legacy REST APIs)
|
|
297
|
+
agentsecrets call --url https://jira.example.com/rest/api/2/issue \
|
|
298
|
+
--basic JIRA_CREDS
|
|
299
|
+
|
|
300
|
+
# JSON body injection
|
|
301
|
+
agentsecrets call --url https://api.example.com/auth \
|
|
302
|
+
--body-field client_secret=SECRET
|
|
303
|
+
|
|
304
|
+
# Form field injection
|
|
305
|
+
agentsecrets call --url https://oauth.example.com/token \
|
|
306
|
+
--form-field api_key=KEY
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## AI Tool Integrations
|
|
312
|
+
|
|
313
|
+
### Claude Desktop + Cursor (MCP)
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
agentsecrets mcp install
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Auto-configures your MCP setup. No credential values in any config file.
|
|
320
|
+
|
|
321
|
+
```json
|
|
322
|
+
{
|
|
323
|
+
"mcpServers": {
|
|
324
|
+
"agentsecrets": {
|
|
325
|
+
"command": "/usr/local/bin/agentsecrets",
|
|
326
|
+
"args": ["mcp", "serve"]
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### OpenClaw (Skill + Exec Provider)
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
openclaw skill install agentsecrets
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
AgentSecrets ships as both a ClawHub skill and a native exec provider for OpenClaw's SecretRef system (shipped in v2026.2.26). The agent manages the full secrets workflow autonomously within OpenClaw.
|
|
339
|
+
|
|
340
|
+
### Any AI Assistant (Workflow File)
|
|
341
|
+
|
|
342
|
+
`agentsecrets init` creates `.agent/workflows/agentsecrets.md` — a workflow file that teaches any AI assistant how to use AgentSecrets automatically. Claude, Gemini, Copilot, or any tool that reads workflow files picks it up without configuration.
|
|
343
|
+
|
|
344
|
+
### Environment Variable Injection
|
|
345
|
+
|
|
346
|
+
For tools that manage their own credential storage (Stripe CLI) or SDKs that read from environment variables:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Wrap any command — secrets injected as env vars
|
|
350
|
+
agentsecrets env -- python manage.py runserver
|
|
351
|
+
agentsecrets env -- celery -A myapp worker
|
|
352
|
+
agentsecrets env -- pytest
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Values exist only in the child process memory. Nothing is written to disk. When the process exits, the secrets are gone.
|
|
356
|
+
|
|
357
|
+
**Claude Desktop config (wrapping native Stripe MCP):**
|
|
358
|
+
|
|
359
|
+
```json
|
|
360
|
+
{
|
|
361
|
+
"mcpServers": {
|
|
362
|
+
"stripe": {
|
|
363
|
+
"command": "agentsecrets",
|
|
364
|
+
"args": ["env", "--", "stripe", "mcp"]
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### HTTP Proxy (Any Agent or Framework)
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
agentsecrets proxy start
|
|
374
|
+
|
|
375
|
+
curl http://localhost:8765/proxy \
|
|
376
|
+
-H "X-AS-Target-URL: https://api.stripe.com/v1/charges" \
|
|
377
|
+
-H "X-AS-Inject-Bearer: STRIPE_KEY"
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Works with LangChain, CrewAI, AutoGen, and any agent that makes HTTP requests.
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Build on AgentSecrets
|
|
385
|
+
|
|
386
|
+
The [AgentSecrets SDK](https://github.com/The-17/agentsecrets-sdk) lets you build tools, MCP servers, and AI agents where credential values never enter your code — or the code of anyone using what you build.
|
|
387
|
+
|
|
388
|
+
```python
|
|
389
|
+
pip install agentsecrets
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
```python
|
|
393
|
+
from agentsecrets import AgentSecrets
|
|
394
|
+
|
|
395
|
+
as_client = AgentSecrets()
|
|
396
|
+
|
|
397
|
+
response = as_client.call(
|
|
398
|
+
url="https://api.stripe.com/v1/balance",
|
|
399
|
+
bearer="STRIPE_KEY"
|
|
400
|
+
)
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
You pass a key name. The SDK resolves from the OS keychain, injects at the transport layer, returns only the API response. Every user of every tool built on the SDK gets zero-knowledge credential management automatically.
|
|
404
|
+
|
|
405
|
+
**Built on the SDK:**
|
|
406
|
+
- [AgentSecrets MCP Server Template](https://github.com/The-17/agentsecrets-mcp-template) — scaffold for building MCP servers with zero credential storage
|
|
407
|
+
- [AgentSecrets for LangChain](https://github.com/The-17/agentsecrets-langchain) — zero-knowledge API calls in any LangChain agent
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## Full Command Reference
|
|
412
|
+
|
|
413
|
+
### Account
|
|
414
|
+
```bash
|
|
415
|
+
agentsecrets init # Create account or login
|
|
416
|
+
agentsecrets login # Login to existing account
|
|
417
|
+
agentsecrets logout # Clear session
|
|
418
|
+
agentsecrets status # Current user, workspace, project, last sync
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Workspaces
|
|
422
|
+
```bash
|
|
423
|
+
agentsecrets workspace create "Name" # Create workspace
|
|
424
|
+
agentsecrets workspace list # List workspaces
|
|
425
|
+
agentsecrets workspace switch "Name" # Switch active workspace
|
|
426
|
+
agentsecrets workspace invite user@email # Invite teammate
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Projects
|
|
430
|
+
```bash
|
|
431
|
+
agentsecrets project create my-app # Create project
|
|
432
|
+
agentsecrets project list # List projects in current workspace
|
|
433
|
+
agentsecrets project use my-app # Set active project
|
|
434
|
+
agentsecrets project update my-app # Update project
|
|
435
|
+
agentsecrets project delete my-app # Delete project
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Secrets
|
|
439
|
+
```bash
|
|
440
|
+
agentsecrets secrets set KEY=value # Store a secret
|
|
441
|
+
agentsecrets secrets get KEY # Retrieve a value (you see it, agent doesn't)
|
|
442
|
+
agentsecrets secrets list # List key names — never values
|
|
443
|
+
agentsecrets secrets push # Upload .env to cloud (encrypted)
|
|
444
|
+
agentsecrets secrets pull # Download cloud secrets to keychain
|
|
445
|
+
agentsecrets secrets delete KEY # Remove a secret
|
|
446
|
+
agentsecrets secrets diff # Compare local vs cloud
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Proxy & Calls
|
|
450
|
+
```bash
|
|
451
|
+
agentsecrets call --url <URL> --bearer KEY # One-shot authenticated call
|
|
452
|
+
agentsecrets proxy start [--port 8765] # Start HTTP proxy
|
|
453
|
+
agentsecrets proxy status # Check proxy status
|
|
454
|
+
agentsecrets proxy logs [--last N] # View audit log
|
|
455
|
+
agentsecrets exec # OpenClaw exec provider (reads stdin)
|
|
456
|
+
agentsecrets mcp serve # Start MCP server
|
|
457
|
+
agentsecrets mcp install # Auto-configure AI tools
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### Environment Injection
|
|
461
|
+
```bash
|
|
462
|
+
agentsecrets env -- <command> [args...] # Inject secrets as env vars into child process
|
|
463
|
+
agentsecrets env -- python manage.py migrate # Wrap Django
|
|
464
|
+
agentsecrets env -- celery -A app worker # Wrap Celery
|
|
465
|
+
agentsecrets env -- pytest # Wrap Pytest
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Workspace Security
|
|
469
|
+
```bash
|
|
470
|
+
agentsecrets workspace allowlist add <domain> [domain...] # Authorize domains
|
|
471
|
+
agentsecrets workspace allowlist list # List allowed domains
|
|
472
|
+
agentsecrets workspace allowlist log # View allowlist audit log
|
|
473
|
+
agentsecrets workspace promote user@email.com # Grant admin role
|
|
474
|
+
agentsecrets workspace demote user@email.com # Revoke admin role
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## vs. Traditional Secrets Management
|
|
480
|
+
|
|
481
|
+
| | AgentSecrets | HashiCorp Vault | AWS Secrets Manager | Doppler | 1Password |
|
|
482
|
+
|---|---|---|---|---|---|
|
|
483
|
+
| **Agent as operator** | ✅ Full lifecycle | ❌ Consumer only | ❌ Consumer only | ❌ Consumer only | ❌ Consumer only |
|
|
484
|
+
| **Zero-knowledge end to end** | ✅ Every step | ❌ Agent retrieves value | ❌ Agent retrieves value | ❌ Agent retrieves value | ⚠️ Partial |
|
|
485
|
+
| **Domain allowlist enforcement** | ✅ Deny-by-default | ❌ | ❌ | ❌ | ❌ |
|
|
486
|
+
| **Response body redaction** | ✅ Echo exfiltration defense | ❌ | ❌ | ❌ | ❌ |
|
|
487
|
+
| **Prompt injection protection** | ✅ Structural | ❌ | ❌ | ❌ | ❌ |
|
|
488
|
+
| **Env var injection (`run --`)** | ✅ `agentsecrets env` | ❌ | ❌ | ✅ `doppler run` | ✅ `op run` |
|
|
489
|
+
| **AI-native workflow** | ✅ Built for it | ❌ | ❌ | ❌ | ❌ |
|
|
490
|
+
| **SDK for building on top** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
491
|
+
| **Team workspaces** | ✅ Built-in | ⚠️ Complex | ⚠️ IAM roles | ✅ | ✅ Vaults |
|
|
492
|
+
| **OS keychain storage** | ✅ | ❌ | ❌ | ❌ | ✅ |
|
|
493
|
+
| **Setup time** | ⚡ 1 minute | ⏱️ Hours | ⏱️ 30+ min | ⏱️ 10 min | ⏱️ 5 min |
|
|
494
|
+
| **Free** | ✅ | ✅ OSS | ⚠️ AWS costs | ⚠️ Limited | ❌ |
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## Use Cases
|
|
499
|
+
|
|
500
|
+
### Solo Developer
|
|
501
|
+
```bash
|
|
502
|
+
agentsecrets init
|
|
503
|
+
agentsecrets secrets set STRIPE_KEY=sk_live_...
|
|
504
|
+
agentsecrets mcp install
|
|
505
|
+
# Ask Claude to check your Stripe balance. It manages the call. Never sees the key.
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
### Team Onboarding
|
|
509
|
+
```bash
|
|
510
|
+
agentsecrets login
|
|
511
|
+
agentsecrets workspace switch "Acme Engineering"
|
|
512
|
+
agentsecrets project use payments-service
|
|
513
|
+
agentsecrets secrets pull
|
|
514
|
+
# Ready. No credential sharing. No .env files sent over Slack.
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### Autonomous Agent Deployment
|
|
518
|
+
```bash
|
|
519
|
+
# Agent handles this entire flow without human intervention
|
|
520
|
+
agentsecrets secrets diff # checks for drift
|
|
521
|
+
agentsecrets secrets pull # syncs if needed
|
|
522
|
+
agentsecrets workspace switch production
|
|
523
|
+
agentsecrets secrets pull
|
|
524
|
+
agentsecrets env -- python deploy.py
|
|
525
|
+
agentsecrets proxy logs # audits what happened
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Incident Response at 2am
|
|
529
|
+
```bash
|
|
530
|
+
agentsecrets proxy start
|
|
531
|
+
# Claude queries logs, checks database state, calls APIs
|
|
532
|
+
# Full access. Zero credential exposure. Full audit trail.
|
|
533
|
+
# You debug. The agent never held your credentials.
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## Architecture
|
|
539
|
+
|
|
540
|
+
Built with Go for universal compatibility:
|
|
541
|
+
|
|
542
|
+
- **Crypto**: X25519 key exchange + AES-256-GCM encryption + Argon2id key derivation
|
|
543
|
+
- **Keyring**: OS keychain integration (macOS Keychain, Linux Secret Service, Windows Credential Manager)
|
|
544
|
+
- **Proxy**: Local HTTP server with session token, SSRF protection, redirect stripping
|
|
545
|
+
- **Cloud**: Zero-knowledge backend — stores ciphertext only, structurally cannot decrypt
|
|
546
|
+
- **Distribution**: Single binary, ~5-10MB, no runtime dependencies
|
|
547
|
+
|
|
548
|
+
See [ARCHITECTURE.md](docs/ARCHITECTURE.md) and [PROXY.md](docs/PROXY.md) for deep dives.
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
## Roadmap
|
|
553
|
+
|
|
554
|
+
- [x] Core CLI
|
|
555
|
+
- [x] Workspaces + Projects + Team invites
|
|
556
|
+
- [x] Zero-knowledge cloud sync
|
|
557
|
+
- [x] Credential proxy — 6 auth styles
|
|
558
|
+
- [x] MCP server (Claude Desktop, Cursor)
|
|
559
|
+
- [x] HTTP proxy server
|
|
560
|
+
- [x] OpenClaw skill + exec provider
|
|
561
|
+
- [x] Audit logging
|
|
562
|
+
- [x] Multi-platform binaries (macOS, Linux, Windows)
|
|
563
|
+
- [x] npm, pip, Homebrew distribution
|
|
564
|
+
- [x] secrets diff
|
|
565
|
+
- [x] Automatic JWT refresh
|
|
566
|
+
- [x] Zero-trust domain allowlist enforcement
|
|
567
|
+
- [x] Response body redaction (echo exfiltration defense)
|
|
568
|
+
- [x] Workspace role management (promote/demote)
|
|
569
|
+
- [x] `agentsecrets env` — environment variable injection
|
|
570
|
+
- [x] Python SDK (`pip install agentsecrets`)
|
|
571
|
+
- [ ] AgentSecrets MCP Server Template
|
|
572
|
+
- [ ] AgentSecrets for LangChain
|
|
573
|
+
- [ ] AgentSecrets for CrewAI
|
|
574
|
+
- [ ] Secret rotation
|
|
575
|
+
- [ ] Environment support (dev/staging/prod)
|
|
576
|
+
- [ ] Web dashboard
|
|
577
|
+
- [ ] Cloud resolver (serverless + production deployments)
|
|
578
|
+
- [ ] AgentSecrets Connect (multi-tenant credential delegation)
|
|
579
|
+
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
## Security
|
|
583
|
+
|
|
584
|
+
Reporting vulnerabilities: do NOT open public issues.
|
|
585
|
+
Email: hello@theseventeen.co — response within 24 hours.
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Contributing
|
|
590
|
+
|
|
591
|
+
Found a bug? [Open an issue](https://github.com/The-17/agentsecrets/issues)
|
|
592
|
+
Have an idea? [Start a discussion](https://github.com/The-17/agentsecrets/discussions)
|
|
593
|
+
Want to contribute? Check [CONTRIBUTING.md](docs/CONTRIBUTING.md)
|
|
594
|
+
|
|
595
|
+
```bash
|
|
596
|
+
git clone https://github.com/The-17/agentsecrets
|
|
597
|
+
cd agentsecrets
|
|
598
|
+
go mod download
|
|
599
|
+
make build
|
|
600
|
+
make test
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
---
|
|
604
|
+
|
|
605
|
+
## Links
|
|
606
|
+
|
|
607
|
+
- **GitHub**: [github.com/The-17/agentsecrets](https://github.com/The-17/agentsecrets)
|
|
608
|
+
- **SDK**: [github.com/The-17/agentsecrets-sdk](https://github.com/The-17/agentsecrets-sdk)
|
|
609
|
+
- **ClawHub**: [clawhub.ai/SteppaCodes/agentsecrets](https://clawhub.ai/SteppaCodes/agentsecrets)
|
|
610
|
+
- **Related**: [SecretsCLI](https://github.com/The-17/SecretsCLI) — original Python implementation
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
## License
|
|
615
|
+
|
|
616
|
+
MIT — see [LICENSE](LICENSE)
|
|
617
|
+
|
|
618
|
+
Built by [The Seventeen](https://theseventeen.co)
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
**The agent operates it. The agent never sees it.** ⭐
|