Skip to content

Report what allow added as a pyskills.allowed audit event - #53

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

Report what allow added as a pyskills.allowed audit event#53
ncoop57 wants to merge 1 commit into
mainfrom
import-receipt

Conversation

@ncoop57

@ncoop57 ncoop57 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

allow collects the (key, entry) pairs it adds to __pytools__ and raises pyskills.allowed with them after the writes. It raises the event once per call, and only when something was new. Recursive calls (dict entries with callable keys, __allow__) report their own additions.

Why

A host that approves an allow call had no way to learn what the call added. fastaudit's import allowance approves a package's module-level allow while the package initializes. pyskills.allow carries the arguments, and an entry with a policy cannot be rebuilt from arguments alone. Reporting the result lets safepyrun reconcile its policy fingerprint exactly.

Changes

  • allow: an _add helper replaces the direct __pytools__[k].add and .update calls and records the new entries.
  • The lesson cell shows both events.

Companions

AnswerDotAI/fastaudit#25 records the events its allowance passed. AnswerDotAI/safepyrun#71 reads both.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant