axio-tui-guards
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
License
MIT
Metadata
Release files for axio-tui-guards 0.12.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| axio_tui_guards-0.12.2.tar.gz | 86.9 kB | With provenance | Details for axio_tui_guards-0.12.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| axio_tui_guards-0.12.2-py3-none-any.whl | Python 3 | none | any | Details for axio_tui_guards-0.12.2-py3-none-any.whl |
Total release size: 94.5 kB
Release files / axio_tui_guards-0.12.2.tar.gz
| Download URL | axio_tui_guards-0.12.2.tar.gz |
|---|---|
| Size | 86.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17d535d1b8a3e5bda10cb57fc336aa1fefd9c22209dcc76783ff0574321c0396
|
|
BLAKE2b-256 checksum How to use checksums |
c790341bf13c269734b591e1ebfb6a55265549dbd49c08accebd7e3e9f41b61c
|
| 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 18, 2026.
Transparency logRelease files / axio_tui_guards-0.12.2-py3-none-any.whl
| Download URL | axio_tui_guards-0.12.2-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11d073947f8dff9a9e18118491469feafc4fe92fa7fdc301a811bf98f801eb9f
|
|
BLAKE2b-256 checksum How to use checksums |
c307ab1d9491ef6cf776ebf15ba359b33dd4baf16446b5311023959233e76958
|
| 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 18, 2026.
Transparency logSecurity for axio-tui-guards 0.12.2
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.
Attestation for axio_tui_guards-0.12.2.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 18, 2026.
Transparency logA 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.