Skip to main content

tool-permission-gate-py

Policy-check agent tool calls before execution. Pure Python, zero deps. Python port of @mukundakatta/tool-permission-gate.

pip install tool-permission-gate-py
from tool_permission_gate import can_call_tool, filter_tool_calls

policy = {
    "allow": ["search", "fetch", "transfer"],
    "deny": ["shell"],
    "max_amount": 100,
    "require_human_for": ["deploy"],
}

can_call_tool({"name": "search"}, policy)
# Decision(allowed=True, reasons=[], tool='search')

can_call_tool({"name": "transfer", "args": {"amount": 500}}, policy)
# Decision(allowed=False, reasons=['amount_over_limit'], tool='transfer')

filter_tool_calls([{"name": "search"}, {"name": "shell"}], policy)
# [FilteredCall(allowed=True, ...), FilteredCall(allowed=False, reasons=['tool_denied'], ...)]

License

MIT

Metadata

Release files for tool-permission-gate-py 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tool-permission-gate-py 0.1.0
File Size Uploaded Provenance Actions
tool_permission_gate_py-0.1.0.tar.gz 3.4 kB Without provenance Details for tool_permission_gate_py-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tool-permission-gate-py 0.1.0
File Interpreter ABI Platform Actions
tool_permission_gate_py-0.1.0-py3-none-any.whl Python 3 none any Details for tool_permission_gate_py-0.1.0-py3-none-any.whl

Total release size: 7.1 kB

Release files / tool_permission_gate_py-0.1.0.tar.gz

Download URL tool_permission_gate_py-0.1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f5cd68a2aa6fb863fcafd8e7d86854dfd8937f4cac3ac4bc9f4aca4d8e49b26a
BLAKE2b-256 checksum
How to use checksums
9e3fdfd28a57078fac33100b8fa142f5f67244cb94712b80c6b4f4a3effb4804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / tool_permission_gate_py-0.1.0-py3-none-any.whl

Download URL tool_permission_gate_py-0.1.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db0abdc7ad01ab9e265024e7a1de5a9e6c796d23dda75c86a816d23bc6e1eb80
BLAKE2b-256 checksum
How to use checksums
105d12771c4d0694e42721daa4fb24d8a7d84adc1de7b5842a289c79e1ada71c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for tool-permission-gate-py 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page