Skip to content

Record the events the import allowance passes - #25

Open
ncoop57 wants to merge 1 commit into
mainfrom
import-receipt
Open

Record the events the import allowance passes#25
ncoop57 wants to merge 1 commit into
mainfrom
import-receipt

Conversation

@ncoop57

@ncoop57 ncoop57 commented Aug 27, 2026

Copy link
Copy Markdown

Summary

When the import allowance passes an audited event, chk appends (event, args) to data['import_approved'], if the host supplied that list. Hosts that pass no list see no change.

Why

The allowance passes every event raised while an opted-in package initializes, and records nothing. A host that keeps policy state of its own cannot tell an approved import's side effects from tampering. safepyrun fingerprints __pytools__ around each run, and an opted-in package's first sandboxed import raises sandbox policy changed during execution there. With the record, the host can subtract what the allowance approved. fastaudit still knows nothing about what the events mean.

Changes

  • fastaudit/core.py: three lines in chk.
  • README.md: one sentence under the import-allow section.
  • tests/test_core.py: one assertion in test_allowed_import_side_effects. Two references updated from exhash_file to file_exhash. exhash renamed it in July and the suite had not collected since.

Companions

AnswerDotAI/pyskills#53 reports what allow added as a pyskills.allowed event. AnswerDotAI/safepyrun#71 reads both. This change depends on neither.

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