Auditing Python Install Hooks: Reproducing the agent-framework Credential Theft in a Lab
Public reporting in November 2026 said hijacked releases of Microsoft's agent-framework package on PyPI were used to steal Azure and GitHub credentials. The summaries leave the exact malicious versions, the compromise path, and whether the artefacts were sdists or wheels unknown. This short follows the post's defensive lab: a local PEP 503 index, a local collector, fabricated canary credentials, and a Docker network with no egress. It shows a minimal build hook that reads the install environment and posts to the collector, then covers the audit surfaces and the controls that reduce exposure: Trusted Publishing, scoped tokens, and lockfiles. The lab is intentionally local and uses fake credentials. Read the full walkthrough with commands and captured output at https://hackyjs.com/posts/auditing-python-install-hooks-reproducing-the-agent-framework-credential-theft-in-a-lab