Skip to content

fix(pi): stop recording allowed scoped rm as bash denied - #898

Closed
gewenyu99 wants to merge 1 commit into
mainfrom
posthog-code/fix-bash-denied-telemetry
Closed

gewenyu99 wants to merge 1 commit into
mainfrom
posthog-code/fix-bash-denied-telemetry

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Problem

Telemetry shows rm .posthog-events.json as bash denied ("not in allowlist") on pi runs — but the command actually runs. evaluateToolCall consulted wizardCanUseTool before applying the scoped-rm rescue from #834, and wizardCanUseTool captures a bash denied analytics event on every deny. So every allowed scoped rm is recorded as a denial, indistinguishable from a real block in the data.

Part of the telemetry findings in #894's investigation thread.

Fix

Decide the rescue first and skip the allowlist check entirely for a scoped rm. The gate decision is unchanged — a rescued rm overrode any deny before, and it still falls through to the shared YARA scan — only the spurious telemetry goes away.

Testing

  • New test pins the behavior: an allowed scoped rm never captures a bash denied event.
  • All 44 pi-security tests pass (containment, injection, quoting, glob/.env/recursion blocks unchanged); pnpm build && pnpm test — 1322 passed.

Created with PostHog Code

evaluateToolCall consulted wizardCanUseTool before applying the
scoped-rm rescue (#834), and wizardCanUseTool captures a `bash denied`
analytics event on every deny — so every allowed `rm .posthog-events.json`
still showed up in telemetry as a denial, indistinguishable from a real
block.

Decide the rescue first and skip the allowlist entirely for a scoped rm.
The gate decision is unchanged (a rescued rm overrode any deny before,
and it still falls through to the YARA scan); only the spurious
telemetry goes away.

Generated-By: PostHog Code
Task-Id: 3d7ba1ec-5512-45cb-ac94-2e88f074e7d5
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run 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:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@gewenyu99

Copy link
Copy Markdown
Collaborator Author

Superseded by #901 — redone without the reorder hack. #901 makes wizardCanUseTool a pure predicate, moves the scoped-rm allowance into the shared allowlist (parity), and emits bash-denied at each harness's enforcement point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant