Skip to main content

axio-tui-guards

PyPI Python License: MIT

Permission guard plugins for axio-tui.

The TUI applies its built-in permission policy to every agent tool. Read-only file access inside the project is automatic. Other operations require explicit rules or confirmation. See TUI permissions.

This optional package supplies an LLM reviewer and the legacy standalone PathGuard. The TUI uses LLM review as advice in its permission dialog. A SAFE verdict cannot replace user approval or override an explicit denial.

Installation

pip install axio-tui-guards

The base package requires only axio. Both guards accept an asynchronous prompt_fn callback and work without Textual or axio-tui. The verdict type is axio_tui_guards.guards.Confirm. Install axio-tui-guards[tui] only when using the optional Textual dialogs.

Or install as part of the TUI bundle:

pip install "axio-tui[guards]"

Guards

PathGuard

Legacy standalone guard for applications that attach it explicitly. The TUI no longer instantiates it: its directory-wide grants cannot distinguish reads from writes. New applications should use axio.permission_policy.PolicyGuard and provider access declarations instead. PathGuard examines only the first recognized path parameter; it is not filesystem isolation.

from axio_tui_guards.guards import PathGuard
from axio.tool import Tool

guard = PathGuard()  # defaults to console input; applications can pass prompt_fn

tool = Tool(
    name="write_file",
    description="Write a file",
    handler=write_file,
    guards=(guard,),
)

Legacy decisions: y grants the inferred directory and its descendants for this instance, n denies once, and deny remembers an exact path denial. No decision persists across process restarts. This API remains for compatibility only.

LLMGuard

review() returns advice for the TUI's unified permission prompt. Missing or invalid verdicts and review failures require explicit permission. Categories never create stored grants.

When used directly as a standalone PermissionGuard, check() accepts SAFE, rejects DENY, and asks for an explicit y on RISKY. This standalone API does not replace the TUI policy.

from axio_tui_guards.guards import LLMGuard
from axio.agent import Agent
from axio.context import MemoryContextStore
from axio.testing import StubTransport, make_text_response

reviewer = Agent(system="", tools=[], transport=StubTransport([make_text_response("allow")]))
guard = LLMGuard(agent=reviewer, context=MemoryContextStore())

Composing guards

Guards are applied in order. Existing standalone applications can still compose them:

from axio_tui_guards.guards import PathGuard, LLMGuard
from axio.agent import Agent
from axio.context import MemoryContextStore
from axio.testing import StubTransport, make_text_response
from axio.tool import Tool

reviewer = Agent(system="", tools=[], transport=StubTransport([make_text_response("allow")]))
tool = Tool(
    name="shell",
    description="Run shell commands",
    handler=shell,
    guards=(PathGuard(), LLMGuard(agent=reviewer, context=MemoryContextStore())),
)

Custom guards

Implement the PermissionGuard protocol to write your own:

from typing import Any
from axio.permission import PermissionGuard
from axio.exceptions import GuardError


class MyGuard(PermissionGuard):
    async def check(self, tool: Any, **kwargs: Any) -> dict[str, Any]:
        if "rm -rf" in str(kwargs.get("command", "")):
            raise GuardError("Refusing to run rm -rf")
        return kwargs

Plugin registration

[project.entry-points."axio.guards"]
path = "axio_tui_guards.guards:PathGuard"
llm  = "axio_tui_guards.guards:LLMGuard"

Part of the axio ecosystem

axio · axio-tui

License

MIT

Metadata

Release files for axio-tui-guards 0.12.4

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

Source distribution (sdist)

Source distribution for axio-tui-guards 0.12.4
File Size Uploaded Provenance Actions
axio_tui_guards-0.12.4.tar.gz 86.9 kB With provenance Details for axio_tui_guards-0.12.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for axio-tui-guards 0.12.4
File Interpreter ABI Platform Actions
axio_tui_guards-0.12.4-py3-none-any.whl Python 3 none any Details for axio_tui_guards-0.12.4-py3-none-any.whl

Total release size: 94.5 kB

Release files / axio_tui_guards-0.12.4.tar.gz

Download URL axio_tui_guards-0.12.4.tar.gz
Size 86.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c4a54ebe3534fca45d67f84feea15d3c88ef41bb24c2e0f41ae536edb74b6b38
BLAKE2b-256 checksum
How to use checksums
954dcfee1c8a9370c29fe9ce13066d9fa0d968526f1b777f769fbd749959840a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / axio_tui_guards-0.12.4-py3-none-any.whl

Download URL axio_tui_guards-0.12.4-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd2f9fb927d4d2cafc7560bc56abda6875bf2fc3dcfb301f73a4c30c64f6eebc
BLAKE2b-256 checksum
How to use checksums
b93e2a8e86c4b9c5b529edf67f90e30a9556a64f6aa664241f1792f2b01447c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for axio-tui-guards 0.12.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for axio_tui_guards-0.12.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

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.12.4 This release

2 release files Full 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