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.1

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.1
File Size Uploaded Provenance Actions
axio_tui_guards-0.12.1.tar.gz 86.9 kB With provenance Details for axio_tui_guards-0.12.1.tar.gz

Built distribution (wheel)

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

Total release size: 94.5 kB

Release files / axio_tui_guards-0.12.1.tar.gz

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

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 Oct 17, 2026.

Transparency log

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

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

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 Oct 17, 2026.

Transparency log

Security for axio-tui-guards 0.12.1

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.1.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 Oct 17, 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.1 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