Problem
When using CodeGraff from an agentic coding environment, users may paste a cg_sk_ key into chat and ask the agent to run a live SDK/API smoke test. The agent can technically call the SDK/API, but command strings and tool outputs are recorded in transcripts/logs.
Current options are awkward:
- Put CODEGRAFF_API_KEY inline in a shell command, which records the secret.
- Ask the user to manually export it outside the agent session, which blocks autonomous testing.
- Decline the live test even though the key was intentionally provided for agent use.
This happened while trying to run a minimal @codegraff/sdk smoke test with model deepseek-v4. The SDK installed and imported, but the live call was blocked by secret-handling concerns.
Expected behavior
Provide an agent-friendly way to run one-off local tests without echoing the API key into commands or logs.
Potential fixes:
- CLI reads key from stdin without printing it, e.g. codegraff auth set --stdin or codegraff smoke --api-key-stdin.
- SDK/CLI supports reading a key from a file path with clear gitignore guidance.
- Document a short-lived test-token flow for coding agents.
- Provide a documented deepseek-v4 smoke command that uses env-only auth and avoids inline shell secrets.
- Add redaction guidance/helpers for agent environments where command strings are persisted.
Repro context
- npm install @codegraff/sdk
- Verify import works from Node and exports Graff plus Sandbox.
- Attempt a live smoke call with a pasted cg_sk_ key and model deepseek-v4.
The blocker is safe secret handling, not SDK installation/import.
Security note
Any key pasted into chat should be treated as exposed and rotated after use. This issue is about making the intended agent-use case safer and less likely to leak secrets into transcripts/logs.
Problem
When using CodeGraff from an agentic coding environment, users may paste a cg_sk_ key into chat and ask the agent to run a live SDK/API smoke test. The agent can technically call the SDK/API, but command strings and tool outputs are recorded in transcripts/logs.
Current options are awkward:
This happened while trying to run a minimal @codegraff/sdk smoke test with model deepseek-v4. The SDK installed and imported, but the live call was blocked by secret-handling concerns.
Expected behavior
Provide an agent-friendly way to run one-off local tests without echoing the API key into commands or logs.
Potential fixes:
Repro context
The blocker is safe secret handling, not SDK installation/import.
Security note
Any key pasted into chat should be treated as exposed and rotated after use. This issue is about making the intended agent-use case safer and less likely to leak secrets into transcripts/logs.