Intercept and approve filesystem-modifying syscalls
Project description
ptrace-approve
Approve a programs actions from the command-line. Remeber choices.
Claude code approval system for the code generated by claude code.
This is ai-generated unreviewed code. I have used it a coouple of times.
Caveats
AI-generated code, unreviewed, slow. This runs python code on every system call so for some use cases is very slow.
Motivation
I wanted to rub some vibe coded apps over my code and not have it destroy my code.
Alternatives and prior work
This is influenced form a UI perspective by cluade code, where you approve individual commands as claude wishes to run them, optionally adding exceptions. There is a tool called maybe which is a similar idea and has been declared as unmaintained by it's previous maintainer.
ptrace-approve uses ptrace and apparmor does similar things. Apparmor is faster, and can record rules to allow - but not does not have this sort of interactive real time approval. ptrace-approve use the python-pytrace library which does all the fiddly work.
Tools like austral can place limits at the module or function level using a type systems.
Installation
pipx install ptrace-approve
Usage
ptrace-approve app
By default all reads are allowed.
Individually approve rules or add patterns. . in patterns does not match ,'s or brackets. Use (.|[.(),]) for the conventional meaning of . in regexps
the abolsute path to app app is found and a default profile is stored for the app based on this path.
ptrace-approve --clear app
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ptrace_approve-1.0.3.tar.gz.
File metadata
- Download URL: ptrace_approve-1.0.3.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd4d91cbb727ada763161505c50c924748750a69d476e15e4bb7eb04b13b5ffb
|
|
| MD5 |
45d5f47005b2c10f285655e4c3645c8c
|
|
| BLAKE2b-256 |
2c7eb24b58fc4ffd9025c1324f3cb7a291b4df8b29abc051d391e2ddf570d2c2
|
File details
Details for the file ptrace_approve-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ptrace_approve-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dd04f104b64018f641e3504601ff057a79eeadc38dae673cdb1c91d60b04a45
|
|
| MD5 |
e9a6c1ade377a27f10187388210abc97
|
|
| BLAKE2b-256 |
5942d6e14be6a79d1ac8219c01b2fbfdb68900ce7e60cb2342b4c7310362cff5
|