Repository navigation
fix(web): keep the private ingest key out of onboarding snippets and the agent prompt - #1182
JeremyFunk wants to merge 2 commits into
Conversation
…the agent prompt Server snippets read MAPLE_INGEST_KEY and skip export with one warning when it is unset. The Claude Code prompt carries only the endpoint and public key and tells the agent the user sets MAPLE_INGEST_KEY themselves, matching the maple-onboard skill. The checklist's credentials column shows both keys.
Maple review🟡 Confidence 3/5 · needs attention Moves the onboarding instrument snippets and the Claude Code prompt off the inlined ingest key onto
Findings🟠 Warning · F1 · Prompt sends servers to
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughGuided onboarding and quick-start server snippets now distinguish the public ingest key from the private ChangesIngest key handling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: 🟡 Moderate · up to Server snippets now use environment-backed credentials, but the onboarding skill still directs users to inline keys. Align the skill and prompt before merging so generated integrations follow consistent credential-handling rules. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change reduces embedded credential exposure and preserves organization-admin access controls. However, the new environment-based setup guidance conflicts with the companion installation instructions, leaving the intended credential separation inconsistent. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| `My ingest endpoint is ${ingestUrl}.`, | ||
| `My ingest key is ${ingestKey || "<your-ingest-key>"}.`, | ||
| ...(publicKey ? [`My public ingest key for browser and mobile code is ${publicKey}.`] : []), | ||
| "Server code reads my private key from MAPLE_INGEST_KEY, which I set in my environment or .env myself.", |
There was a problem hiding this comment.
Warning
Prompt sends servers to MAPLE_INGEST_KEY, but the shipped skill says inline the key
F1 · Warning · convention
The prompt tells the agent server code reads the private key from MAPLE_INGEST_KEY set by the user, and all six instrument snippets assert MAPLE_INGEST_KEY is set, warn and skip the exporter. The shipped rule the prompt invokes, skills/maple-onboard/SKILL.md:34 and :185, still says the ingest key is inlined in the bootstrap source and lists env-var indirection as a failure mode ("env-var indirection just adds deploy-time failure modes for no gain"), and its public-key path (:43) inlines it in every bootstrap file, servers included. Until #1115 lands with these snippets, the agent gets one instruction from the prompt and the opposite from the skill it must read, so a user who pastes the prompt can still end up with the key inlined in server source.
Land the skill change (`skills/maple-onboard/SKILL.md` Step 0 and Hard rules) in the same release as these snippets, or keep the prompt's server line only once that rule is on main.
🤖 Prompt to fix with an AI agent
In `apps/web/src/components/ingest/onboard-skill.ts:12`: Prompt sends servers to `MAPLE_INGEST_KEY`, but the shipped skill says inline the key.
The prompt tells the agent server code reads the private key from `MAPLE_INGEST_KEY` set by the user, and all six instrument snippets assert `MAPLE_INGEST_KEY` is set, warn and skip the exporter. The shipped rule the prompt invokes, `skills/maple-onboard/SKILL.md:34` and `:185`, still says the ingest key is inlined in the bootstrap source and lists env-var indirection as a failure mode ("env-var indirection just adds deploy-time failure modes for no gain"), and its public-key path (`:43`) inlines it in every bootstrap file, servers included. Until #1115 lands with these snippets, the agent gets one instruction from the prompt and the opposite from the skill it must read, so a user who pastes the prompt can still end up with the key inlined in server source.
Suggested fix: Land the skill change (`skills/maple-onboard/SKILL.md` Step 0 and Hard rules) in the same release as these snippets, or keep the prompt's server line only once that rule is on main.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
Maple review🟡 Confidence 3/5 · needs attention The head commit drops the credentials column from the guided-setup browser tests so they render without a query provider. The snippet and prompt changes it guards were already reviewed; no new defect. F1 (prompt tells servers to read
Still open from earlier reviews
What was checked
|
Brings the in-product onboarding in line with the
maple-onboardskill's key rules (#1115): servers read the private key fromMAPLE_INGEST_KEY, browser/mobile code inlines the public key, and the private key never goes into a prompt pasted into an AI tool.sdk-snippets.ts): Next.js, Node, Python, Go and the generic OTel env snippet readMAPLE_INGEST_KEYinstead of inlining the public key. When it is unset they logMAPLE_INGEST_KEY is not set; Maple telemetry export is disabledand skip the Maple exporter: no throw, no exit, noBearer undefined. The shell snippet setsOTEL_SDK_DISABLED=truein that case. The Effect snippet already read the env var; its comment now names the private key.onboard-skill.ts): carries the endpoint, the public key (labelled for browser and mobile code), and a line saying the user setsMAPLE_INGEST_KEYthemselves. With no public key loaded, the key line is dropped so the skill falls back toMAPLE_TEST, instead of inlining a<your-ingest-key>placeholder.guided-setup.tsx): the Claude Code tab tells the user to setMAPLE_INGEST_KEYin.envand their deployment secrets. The checklist's credentials column reusesConnectCredentials(endpoint + public + private key, admin fallback), replacing the single "API key" field that showed the public key. The instrument block no longer carries a key, so it drops the replay block; the prompt block keeps it.Decisions:
install-modal.tsx) still puts the private key on the helm/docker command lines; that is a separate collector flow.Tests:
onboard-skill.test.ts,guided-setup.browser.test.tsxupdated; newsdk-snippets.test.tsasserts every snippet readsMAPLE_INGEST_KEYand inlines no key.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
MAPLE_INGEST_KEY, which should be set in your environment or deployment secrets.