AIShell Labs LLC  ·  Public Beta

AIShell-Gate
AI Execution Gateway for Unix

A deterministic policy layer that mediates between probabilistic AI systems and deterministic Unix infrastructure. Every AI-generated command passes through a policy gate before execution — never through a shell.

default deny deterministic tamper-evident audit no shell execution human confirmation policy layering no external dependencies

01 Introduction

Large language models are increasingly used to generate shell commands. They are good at it. They are also probabilistic. Unix execution, by contrast, is deterministic and irreversible — a single misplaced flag or path can permanently alter system state.

AIShell-Gate exists to close that gap. It sits between an AI agent's proposed actions and the operating system, evaluating every command against declared policy before a single byte reaches the kernel. Unsafe commands are denied with a reason. Safe commands are allowed — with a confirmation level appropriate to their risk. No shell is ever invoked.

AI Agent JSON action plan aishell-gate-exec (no policy logic — pure execution harness) forks policy engine for each action aishell-gate-policy (deterministic policy engine — separate process) ALLOW / DENY + confirmation level + validated argv aishell-gate-exec (collects human confirmation if required) execve(absolute_path, validated_argv, safe_environment) (no shell — no PATH inheritance — no environment injection)

The separation between the two programs is the central security property of the system. The executor has no policy logic; the policy engine has no ability to execute. Neither component can reach across that boundary.

02 The Programs

aishell-gate-policy
Policy Engine  ·  v0.66.0-beta

Receives a proposed shell command, normalizes it, evaluates it against a layered policy stack, computes a risk score, and emits a structured JSON decision. It never executes anything. Its only output is the decision record: allow or deny, confirmation level, matched rule and layer, validated argument array, risk score, blast radius, and reason.

aishell-gate-exec
Executor  ·  v0.25.0-beta

Accepts a JSON action plan from an AI agent, submits each command to the policy engine as a child process, reads the JSON decision back over a pipe, collects human confirmation where the policy requires it, and calls execve() with the validated argument vector. Contains no policy logic of its own.

The architectural principle The executor-separation principle is not a convenience — it is the core security property. If the executor is compromised through a bug, a malicious plan, or a hostile environment, it still cannot grant itself permission to run a command the policy engine has denied. Permission is not a variable inside the executor. It is the output of an independent process the executor has no ability to modify.

Policy Layers

Policy is a stack of three layers evaluated in order: base (organizational floor), project (workflow-specific rules), and user (personal preferences). A deny at any layer is final. The built-in presets — ops_safe, dev_sandbox, read_only, danger_zone — give teams a working starting posture without manually assembling policy files.

Confirmation Levels

Every ALLOW decision carries a confirmation level: none (proceed immediately), plan (show the plan before running), action (explicit per-command approval), or typed (operator must type a code derived from the exact command). Risk scoring escalates levels automatically — commands scoring above 40, 70, or 90 are raised to plan, action, or typed regardless of what the matching rule says. Levels can only be raised, never lowered.

Audit Chain

Every evaluation can be written to a tamper-evident JSON Lines audit log. Each entry carries a sequence number, session identifier, full decision context, and an SHA-256 hash linking it to the preceding entry. HMAC-SHA256 mode restricts verification to key-holders. Concurrent sessions write safely via advisory file locking.

03 Documentation

The following documents are included with this release. All are available in the same directory.

Note: The Getting Started Guide covers local and single-session use. The Remote Deployment Guide covers SSH-based remote access. Read the Getting Started Guide first.

04 Public Beta

AIShell-Gate Binary Beta Release will soon be available as a public beta. Documentation is available now from the links above. The core architecture is stable. The policy model is functional. The goal of the beta phase is to gather real-world usage patterns, policy design feedback, integration experience, and edge cases that only surface in practice.

▸ Public Beta — aishell-gate-policy 0.66.0  ·  aishell-gate-exec 0.25.0

AIShell-Gate Binary Beta Release

The beta package contains both compiled binaries, all documentation, and the beta README.

Beta scope: the beta is intended for local and single-session use by technically experienced Unix engineers, DevOps teams, and security engineers. Testing should be performed in controlled, non-production environments.

  • Neither binary uses any external libraries — no static linking, no dynamic linking beyond the C standard library
  • Tested on Linux
  • Evaluation copies expire 30 days from download
What the beta is for Does the policy model work for real operational workflows? Are rule definitions intuitive? Are risk classifications appropriate? Are confirmation levels correctly escalated? Are integration points clear and usable? Feedback from practitioners working in real environments is essential to refining the system. AI systems are capable of generating powerful commands. Power without policy is risk. AIShell-Gate exists to make the execution boundary explicit.