Back to Home
· product · apexe
apexe logo

apexe

Governed execution for CLI tools and HTTP APIs

Run your tools. Enforce your rules. apexe gives people and AI agents a shared execution layer built on apcore. Discover existing CLI commands without an LLM or source changes, run them locally or through eligible PATH shims, or expose CLI and imported OpenAPI operations through MCP and A2A. Every call passes three gates in order - the declared surface, the caller-permission policy and the filesystem access boundary - and leaves a typed schema decision and an audit record. Approvals fire on the flags that actually escalate, embedded child commands are policy decisions rather than holes, and a refusal names the gate that decided. Normal execution uses host privileges; selected modules can opt into sandbox delegation with macOS sandbox-exec, Linux bwrap or Docker, and required or auto modes refuse before spawn when the backend cannot enforce the translated path policy.

· 01

Get Started

Rust · Implementation

Rust implementation for Unix CLI tools and HTTP APIs. Install the verified macOS/Linux release with the one-command installer, or build from Git with current stable Rust and Cargo. Native Windows is unsupported; no older minimum Rust version is declared or tested.

Install
$ curl -fsSL https://raw.githubusercontent.com/aiperceivable/apexe/main/scripts/install.sh | sh
Quick Start
shell
# scripts/install.sh hands off to setup; preview or rerun the same
# preparation without reinstalling the binary
apexe setup --dry-run
apexe setup

# Inspect the generated bindings, then review the starter policy
apexe list --verbose
apexe list --path-census
apexe paths --path /etc/passwd --mode read
apexe acl explain cli.git.status --caller local

# Review ~/.apexe/acl.yaml before executing or serving
apexe exec cli.ls --dry-run
apexe exec cli.ls

# Agent Skill native route: requires reviewed native grammar
apexe exec --dry-run -- ls -la
apexe exec -- ls -la

# Optional shell integration for eligible commands
apexe env --enable
source ~/.apexe/bin/apexe-activate.sh
apexe env --check

# Same shims without touching shell startup files
apexe env --enable --no-rc

# MCP HTTP with ACL, interactive approval and Explorer UI
apexe serve --transport http --port 8000 --explorer --acl ~/.apexe/acl.yaml --enable-approval

# Or serve the same bindings through A2A
apexe a2a --acl ~/.apexe/acl.yaml

# Optional: point a terminal agent at the governed shell
apexe agent pi --check
apexe agent pi --write
apexe sh --check

# Opt selected modules into an OS sandbox (off by default)
apexe sandbox check
apexe exec --dry-run -- sed -i 's/a/b/' file

# Optional: serve an API using your specification and reviewed API ACL
apexe serve --openapi ./openapi.yaml --acl ./api-acl.yaml --no-log-arguments

# Check CLI source drift without replacing bindings
apexe verify --report ./drift-report.json
· 02

Features

01Initialize Reviewed Coverage: apexe init acquires reviewed rules from cli-permissions or your own Git source, and generates typed bindings plus a starter ACL for the tools this machine actually has. Policy is authored by apexe acl init and acl sync, never by a scan, so an allow is always one you reviewed.
02Discover CLI Contracts: Six parsers read help, man pages and shell completions, and curated overlays settle what a tool cannot state - including a trailing expression that is parsed rather than forwarded. The result carries types, defaults, enums and argument placement, plus confidence and provenance per flag. No LLM or source changes.
03Execute Locally: apexe exec takes module JSON or eligible native argv, preserves native streams and child exit status, and shows the same checks in advance with --dry-run. Local runs load the default ACL, execute without a shell, and refuse a call that still needs approval instead of guessing.
04Keep Familiar Shell Commands: apexe env installs PATH shims so eligible commands still run by their own names, and apexe-sh gives a host that selects a shell by path an entry point. Each shim loads only the bindings its command can reach and replays the argv you typed; the reviewed corpus covers 22 core commands in BSD and GNU variants. Shims change command lookup: builtins, aliases and absolute paths can bypass them.
05Serve Agents Through MCP and A2A: Publish CLI modules over MCP or as an A2A agent from the same executor, with JWT carrying caller identity and roles when a client presents a token. Import OpenAPI 3.0/3.1 operations alongside them so API calls share one schema, ACL and audit path. HTTP transports require token authentication by default.
06Route Terminal Agents: Claude Code, Codex, pi, OpenCode and other terminal agents can be pointed at apexe itself - apexe agent reports, checks and atomically writes each host's configuration, and apexe hook translates PreToolUse events. The shared Agent Skill remains the fallback where a host cannot be configured; mandatory routing still needs host enforcement.
07Enforce Policy at Execution: A starter ACL denies unknown, destructive and network-reaching modules, and a server will not start without an explicit --acl. Overlays name the flags that escalate, so find reads freely while find -delete reaches the approval gate and is checked as a writer. MCP prompts only with --enable-approval, A2A approval stores are library-only, and audits record no input values.
08Bound and Confine Filesystem Access: Every schema-typed path is checked against a four-list policy - read_only, read_write, no_access and write_only - in systemd's and AppArmor's vocabulary, and the deepest matching entry decides. Selected modules can opt into sandbox delegation through sandbox.modules - macOS sandbox-exec, Linux bwrap or Docker - and required/auto modes refuse before spawn if the backend cannot express the policy.
09Govern Child Commands: A command that runs another program, such as find -exec, is a policy decision rather than a hole - refused by default, resolved to the child's own reviewed module so its schema, ACL, path and approval rules apply, or delegated to the installed child shim with a grant covering those matches only. A command that computes paths inside its own logic must declare it or be refused.
10Inspect the Gates First: Coverage, permission and access are three separate gates, and a refusal names the one that decided. apexe list --path-census sorts PATH commands into granted, denied and unscanned, --diagnostics names routes a curated overlay left closed, apexe paths tests one path against the boundary, and apexe acl explain names the deciding rule.
11Verify Contracts After Changes: apexe verify compares a tool's current output with the pre-overlay baseline, so drift is reported instead of absorbed. Optional readonly, isolated and explicitly authorized cases test concrete invocations, and the evidence is discarded when the binding, binary or case changes - passing cases do not certify every invocation.
12Build Your Own Integrations: Export YAML bindings and optional Claude Skills, embed the Rust library, or export OpenAI tool definitions programmatically. Verbose discovery carries the schema and ACL context, and structured errors plus module guidance let a caller correct a failure instead of retrying it.
· related

Related Products

apcore logo

apcore

The shared registry, schema validation and governed executor behind CLI and API modules.

View Product
apcore-toolkit logo

apcore-toolkit

Scanner, binding and OpenAPI utilities used to describe existing tools.

View Product
apcore-mcp logo

apcore-mcp

MCP serving with structured results, authentication, middleware and Explorer UI.

View Product
apcore-a2a logo

apcore-a2a

A2A serving with authenticated callers over the shared governed executor.

View Product