Repository navigation
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Test against a Context Mill branch:
Add Results will be posted here when complete. |
🤖 Jon's PR agent
|
|
✅ Security review complete — 1 finding posted as a review, in 6 min. Add the |
…acing # Conflicts: # src/programs/posthog-integration/index.ts
| Preserve any tracer provider AIO or Logs configured in earlier steps. Reuse it and | ||
| add a separate span processor with its own exporter to `/i/v1/traces`; never repoint | ||
| an exporter another step set up, and never send spans to `/i/v0/ai/otel`. Set a | ||
| service name. Do not put secrets, tokens, request bodies, or user data in span |
There was a problem hiding this comment.
The new tracing task turns on OTel auto instrumentation with no scrubbing, so query-string tokens and outbound API keys get exported to PostHog as span attributes, despite the prompt's own no-secrets rule
Details
Latent: this goes live once the wizard-default-tracing flag returns 'true' (excludedTaskTypes in src/programs/posthog-integration/index.ts).
src/programs/posthog-integration/agent/tracing.md tells the task to use the skill's capture path (line 20) and to add manual spans only where auto instrumentation has no coverage (lines 47-48). So the default result is OpenTelemetry auto instrumentation on the shared tracer provider, exporting to /i/v1/traces.
The rule on line 46, "Do not put secrets, tokens, request bodies, or user data in span names or attributes", only covers what the agent writes itself. Auto instrumentation fills attributes on its own:
- By default, the OTel HTTP server and client instrumentations record the inbound path with its query string (
http.target, orurl.pathplusurl.query). They also record the full outbound URL (http.url/url.full). Recent versions redact only a few signature parameters. - DB instrumentations record the statement text (
db.statement/db.query.text).
Nothing in the prompt asks the agent to strip any of this.
The new task also drops the guard its sibling logs.md keeps for the same situation: "the app's existing logs are data this run has no mandate to export, and every line that leaves must be visible in this run's diff". Here the data that leaves never shows up in the diff the wizard writes.
Impact — Take an app with a route that carries a credential in the query string, such as GET /reset-password?token=..., /auth/callback?code=... or a magic link. Or take an app that calls a third-party API with ?key= / ?api_key=. After a default wizard run with the flag on, every such request exports that value as a span attribute to the customer's PostHog project. Anyone who can read that project can read it: every project member, and anyone holding a leaked PostHog personal API key with read scope. For example, an analyst who has PostHog access but no production access can query traces for token= and use an unexpired reset token to take over that user's account in the app. The limits: only secrets that the app puts in URLs or SQL text are exposed, and the app's own token expiry still applies.
Fix — Make the prompt require scrubbing of auto-instrumented attributes, and make the handoff disclose what leaves. For example, replace lines 46-48 with:
Auto instrumentation records URLs and queries on its own. Configure it so no
query string leaves the app: strip `url.query`, and the query part of
`url.full`, `http.url` and `http.target`, through the instrumentation's
request/response hooks or a processor or exporter wrapper on the PostHog
exporter only. Do not turn on header capture or DB parameter or enhanced
statement reporting. Do not put secrets, tokens, request bodies, or user data
in span names or attributes you add. List the auto-instrumented attributes
that are exported in your handoff, so the report shows the user what leaves.
Agent-driven security review. The tracing skill lives outside this repo (context-mill) and may already scrub these attributes. OTel defaults also vary by runtime and instrumentation version. No OTel package was available in this environment to probe them, so the confidence is capped.
Problem
Changes
tracingtask afterlogs, only whenwizard-default-tracingreads'true'.wizard-default-mcp-analytics.review.flowchart LR subgraph Before a1[capture] --> b1[ai-observability] --> c1[logs] --> r1[review] end subgraph After a2[capture] --> b2[ai-observability] --> c2[logs] --> t2[tracing] --> r2[review] end class t2 phRed; classDef phRed fill:#f54e00,stroke:#f54e00,color:#fff;Test plan
LLM context
claude-opus-5-5), with thewriting-pr-descriptionsskill.🤖 Generated with Claude Code