Skip to main content

Preloop Logo Preloop

CI Release PyPI Python 3.11+ License OpenSSF Best Practices OpenSSF Scorecard

The open-source AI agent control plane. See them, govern them, cut their cost.

Preloop is one self-hostable service that sits between your AI agents and everything they reach, so every tool call and every model call is governed, attributed, and visible. Four pillars:

  • MCP firewall. Allow, deny, or require approval on any tool call. Optional delegated grant introspection checks upstream bearer grants and required scopes before policy matching.
  • AI model gateway. OpenAI-, Anthropic- and Gemini-compatible ingress, with budgets, allowed-model lists, token accounting, and attribution.
  • Policy-as-code with human approvals. YAML plus CEL. Approve from mobile, watch, Slack, Mattermost, email, or the CLI.
  • Runtime session observability. One timeline per session: tool calls, model calls, policy, approvals, spend, outcomes.

Onboard existing agents with one command. Talk to long-running ones from the console, phone, or watch. Deploy event-driven automations when GitHub, GitLab, Bitbucket Cloud, Jira, or a webhook fires. Works with OpenClaw, Claude Code, Codex CLI, Cursor, Gemini CLI, Hermes, OpenCode, Devin, Copilot CLI, and any MCP-compatible agent.

Flow presets can review pull requests, implement issues, scan for vulnerabilities, collect machine evidence for CRA- and EU AI Act-style reviews (SBOM verify, exploit check); Runtime Observability keeps the session timeline next to it. That is not a conformity assessment, certification, or legal advice. Presets: security audit presets.

Your first five minutes, start to finish:

# 1. Install the CLI (macOS / Linux / WSL)
curl -fsSL https://preloop.ai/install/cli | sh

# Windows, native (PowerShell): irm https://preloop.ai/install/cli.ps1 | iex
# Details: docs/windows-cli.md

# 2. Connect it to a control plane
preloop signup                                # Preloop Cloud (fastest), or
preloop login --url http://localhost:3000    # your self-hosted instance

# 3. Bring local agents under governance
preloop agents discover

preloop agents discover finds local agent configs and reports adapter support for model routing, native action gates, and managed MCP separately. preloop agents onboard configures supported integrations: only calls routed through the managed MCP entry reach the MCP Firewall, while supported model routes use the Gateway. Support and configuration do not verify application behavior; live validation sends a direct gateway route/accounting probe without launching the application. For Talk (operator commands), the CLI can install the runtime plugin (preloop agents install-plugin, or preloop claude for Claude Code). The plugin is what keeps the control channel connected.

Pi and DeepSeek Harness support CLI onboarding, gateway routing, native tool approvals, active-session remote control, and ephemeral flows. Onboard with preloop agents onboard Pi --approvals or preloop agents onboard "DeepSeek Harness" --approvals.

Preloop onboarding local agents into the control plane

Watch it work

Onboarding, the MCP firewall, human approvals, and cutting session cost. Recorded against a real stack, no slideware.

Preloop video series: see them, govern them, cut their cost

Watch the full playlist →

Guides: docs.preloop.ai. Start here: onboard local agents (60s).

For an authorized corporate Claude pilot, see the experimental Anthropic Enterprise hook guide, self-hosted runner identity, managed endpoint rollout and acceptance record. These distinguish synthetic fixtures and merged source from released, deployed and app-verified controls; tenant validation remains pending.

Event-driven employees reuse managed-agent identities and persistent Flows for bounded Codex or Nanobot tasks from tracker events, GlitchTip errors and selected Discord activity, with durable replay protection and scoped model credentials.

A run in progress is not out of reach. Operator notes let an identified human (or, with an opt-in tool, another agent) steer a running agent: the note is delivered at the next turn boundary through the gateway or a hook, adds no model input tokens when there is none, and is recorded with who sent it. Send one from the console, the API, or preloop notes send. Lifecycle hooks deliver startup and final-turn notes on Claude Code, Codex CLI and Cursor where supported; OpenCode, DeepSeek Harness, Hermes and OpenClaw plugins carry notes into native model input where their SDKs support it. The guide lists each harness's carrier and end-receipt limits. The account kill switch goes the other way: it blocks gateway and tool traffic, freezes pending approval deadlines, and requests termination of active managed flow executions, with audited staged recovery.

Finished runs stay searchable, in the console, from preloop sessions search, and by an agent that has been given the search_sessions tool. Keyword ranking is always available, semantic and hybrid ranking are a per-account opt-in, every search is audited, and a question worth repeating can be saved under a name. Two exports turn the agent inventory and the failure record into files an auditor can read: DORA: the AI-agent slice. They feed an Art. 8 inventory and an Art. 28 register, and list Art. 17 incident candidates. Classification stays with your firm, and Preloop covers the agent slice of the ICT estate only.

The Fleet Map connects people, devices, agents, models and observed work in Columns or Spatial view. It keeps manual arrangements, shows live tool and model metadata, and follows flow subjects through published PRs, reported reviews and merges when those events are available.

What you get

Jobs teams otherwise buy from several vendors, in one Apache 2.0 stack:

Capability What it does Alternatives
MCP Firewall Govern every tool call. Allow, deny, require approval, require justification. YAML + CEL. MintMCP, Lunar.dev MCPX, TrueFoundry
AI Model Gateway OpenAI-, Anthropic- and Gemini-compatible. Budgets, allowed-model lists, token accounting, attribution. Portkey, Helicone, LiteLLM, Kong AI
Flows Start an agent when a tracker, webhook, or CI job fires, with the same firewall, approvals, and cost. preloop flow trigger. Custom CI glue, AgentCore Runtime
Cost & Budgets Spend by model, agent, session, API key, flow, and user, including usage you import when the model never hits the gateway, such as GitHub Copilot seats and premium-request spend. FinOps dashboards, vendor billing exports
Human Approvals Mobile, watch, Slack, Mattermost, email, webhook, or preloop approvals. Native Bash/Edit. Agents can ask_user. Custom Slack bots, Peta Desk
Runtime Observability One session timeline: tool calls, model calls, policy, approvals, spend, outcomes. AgentOps, Langfuse, LangSmith
Evidence packs Apache flow presets write result.json plus an evidence directory for CRA / AI Act-style work. Not a certification. Custom GRC folders

Upstream providers include OpenAI, Anthropic, Google, Amazon Bedrock (Bedrock API keys or IAM credentials), Azure OpenAI, Alibaba Cloud Model Studio (Qwen), DeepSeek, Mistral, Moonshot (Kimi), Z.ai (GLM), OpenRouter, and any OpenAI-compatible endpoint you configure. Reviewed model pricing distributes verified tariffs to gateway, API, and worker processes, and Alibaba tariffs preserve regional and cache-policy differences. The weekly review preset prepares tested pricing PRs after you bind its repository and model; historical repricing is a separate operation. Models or billing modes without verified rates remain visibly unpriced. OTLP export is off by default; turn it on and governed model calls and MCP tool calls emit OpenTelemetry GenAI spans to any OTLP backend, without replacing the spend ledger.

AI Agent → Preloop → [Policy]  → Allow / Deny / Require Approval → Execute
                   → [Gateway] → Budget + attribution             → Model

Bitbucket Data Center 10.2 LTS is available as an opt-in, fixture-tested provider for manual PAT discovery and pull request review. It is off by default; live certification and execution/publication routing are separate.

Connect GitHub, GitLab, Bitbucket Cloud, or Jira as flow triggers and issue tools (Bitbucket Cloud setup, Bitbucket and Jira quickstart). Automations ship as presets, including the Issue Triage Assistant, Pull Request Reviewer and Observe / Eval. Or write your own. A flow can also start another flow of the same account as a child of itself, and the execution page shows the resulting tree: flow delegation. Automated issue implementation can resume its PR branch and native agent conversation after review or CI feedback, with durable turn budgets and current-head gates. A finished run whose PR publication was not recorded can be recovered by explicitly selecting and verifying its published PR and branch; when the native checkpoint is unavailable, follow-up requires acknowledgment that it starts a fresh conversation.

Preset copies start disabled so their event types cannot subscribe to every connected repository before configuration. Select the tracker and project scope, save the copy, then explicitly enable it from Flows. Confirmed ad-hoc preset runs remain enabled with tracker event subscriptions cleared.

CI can trigger a flow too: the run-flow GitHub Action (.github/actions/run-flow) starts a flow from a workflow job, streams the execution log, and fails the job on the execution's verdict. Where the agent container runs is your choice. Private runners run it on your own machines over an outbound WebSocket, with no inbound ports: preloop runner fg holds several executions at once (default 2), and --once --ephemeral is a one-shot runner that exists for a single CI job.

Runners advertise docker only after a timed docker ps succeeds, and installed, enabled, signed-in agents contribute capability tags such as cursor_cli and copilot_cli. Personal runners default to asking their owner before each flow execution. Set --flow-execution-consent always|ask_me|never during runner setup, or change the owner preference in the console. Agent owners can also require approval before another member starts a new session; existing sessions continue.

New runners accept tagged work by default; the console can enable untagged jobs or pause new work without stopping current jobs. Native Cursor and Copilot execution works without Docker.

With an Enterprise runner policy provider, Account settings exposes account, role and team requirements; Runners shows member compliance and harness governance. Non-compliant members see a warning when the policy requests it. The console gates these controls on the provider feature and user permissions.

Native restricted CI setup provides OSS console and preloop ci commands for a separate machine identity bound to one project and dedicated hosted flow. Its rotating keys can access only that principal's executions, results and completion subscriptions. Human administration uses safe metadata and one-time secrets; the operator-run Actions example verifies the current approved PR head and persisted completion before separately confirming review publication. The legacy action uses broader account credentials and rejects restricted CI tokens.

Policy-as-code

version: "1.0"
metadata:
  name: "Production Safeguards"

approval_workflows:
  - name: "deploy-approval"
    timeout_seconds: 600
    required_approvals: 1
    async_approval: true

tools:
  - name: "bash"
    source: mcp
    approval_workflow: "deploy-approval"
    justification: required
    conditions:
      - expression: "args.command.contains('deploy') && args.command.contains('production')"
        action: require_approval

Before saving, use Test this rule in the tool rule dialog or Simulate in the Policies YAML editor to check a sample call without running it. Results show the decision, rule order and condition errors.

Ship it with preloop policy apply <file> (validate / diff / export also exist).

Preloop dashboard with live agent and gateway usage

Preloop MCP tool policy rules configured for an example pay tool Governed agent activity in the Preloop console

Talk details for OpenClaw, Hermes, and Claude Code: OpenClaw, Hermes, runtime adapters.

Getting started

The CLI is a client. It talks to a control plane: Preloop Cloud or a stack you run.

Cloud (fastest)

curl -fsSL https://preloop.ai/install/cli | sh
preloop signup
preloop agents discover

Self-host (Docker Compose, data stays on your machine)

curl -fsSL https://preloop.ai/install/oss | sh
curl -fsSL https://preloop.ai/install/cli | sh
preloop login --url http://localhost:3000
preloop agents discover

Console: http://localhost:3000. The CLI stores the instance URL in ~/.preloop/config.yaml. Without --url or PRELOOP_URL, it defaults to https://preloop.ai. preloop auth logout revokes this machine's login and clears it; preloop auth logout --all also revokes every other CLI and console session; preloop auth sessions list and revoke <id> manage individual CLI logins. Command list: CLI authentication.

Public TLS, SMTP (approvals, invites, password resets), upgrades, and Kubernetes: Install the OSS stack, TLS, Upgrading. Helm schema-upgrade budgets and recovery: schema migrations. Helm chart: helm/preloop (private cluster). Docker Compose and Helm are the supported install surfaces; this repository does not ship Terraform modules.

What stays stable across those upgrades, and how a breaking change is announced, is the compatibility policy.

Production self-host: SECRET_KEY is required or the app refuses to start, and the Helm chart refuses to install while environment.jwtSecret is empty or a placeholder (see helm/preloop/README.md). The development docker-compose.yml ships development-only credential defaults; override them with a .env file (start from .env.example). Telemetry is a daily pseudonymous version check-in; set PRELOOP_DISABLE_TELEMETRY=true to disable. Event list: SECURITY.md.

Working in this repository

This file is the product intro. It is not the architecture and not the coding contract.

If you need Read
How the system fits together ARCHITECTURE.md is the map. Read one chapter under docs/architecture/ for the subsystem you are changing. Do not load every chapter "for context."
Commands, DB/CRUD rules, Lit frontend AGENTS.md
PR process CONTRIBUTING.md
Operator and client guides docs.preloop.ai
Compatibility of public surfaces docs/compatibility.md
Policy examples backend/presets/

Do not load this README plus ARCHITECTURE.md end-to-end "for context." Pick the row above.

Open-source alternative to AWS Bedrock AgentCore

Same core jobs (runtime, gateway, identity, observability, policy), vendor-neutral and self-hostable. Full comparison: preloop.ai/vs/aws-agentcore.

Preloop AWS Bedrock AgentCore
Open source (Apache 2.0) Yes No
Self-hostable (VPC / on-prem) Yes No
Policy-as-code (YAML + CEL) Yes Limited
MCP-native tool governance Yes Partial
Human approvals (mobile, Slack, webhook) Yes Limited
Onboard existing local agents (preloop agents discover) Yes No

Also compare: LiteLLM, Portkey, Helicone, MintMCP, Lunar, Runlayer, Zenity.

Editions

Your data: self-hosted, nothing leaves your network except the optional daily version check. On Preloop Cloud, sessions are stored only to give you search, audit trails, cost reports and policy enforcement; they are not used to train models and are not sold or shared. Details: Security & Privacy.

Unqualified Preloop is this repository (Apache 2.0, self-hosted). Preloop Cloud is the hosted service at preloop.ai. Preloop Enterprise is the commercial self-hosted edition.

Cloud is managed hosting. Cloud and Enterprise include support plans. Cloud billing owners can compare the available usage from the previous three completed months in Account settings before requesting a plan-change quote. Missing history is labeled explicitly; a change requires confirmation of its price, limits and effective date. Cloud plan limits do not apply to the open-source self-hosted edition.

Governance itself is open source: every model provider, flows, private runners, session search, operator notes, the audit trail for Preloop-observed activity with collection, query API and console, single-approver workflows and budgets scoped to the account, a flow, an API key or a managed agent all ship in this repository. What is commercial is the organizational layer on top of them: more than one approver, quorum, escalations, budgets scoped to a user or a team, budget notification routing, and users, teams and RBAC on one account. Cloud usage allowances and hosted credits are a separate thing from governance budgets.

For durable audit delivery, enable the default-off PRELOOP_AUDIT_OUTBOX_ENABLED flag after applying migrations. The audit outbox operator guide covers delivery limits, parked failures and bounded account-scoped replay.

Feature Open Source Cloud / Enterprise
Audit collection, query API, and console Yes Yes
Users, teams, and RBAC on one account No Yes
Budgets scoped to a user or a team, budget notification routing No Yes
Multi-approver routing, quorum, escalations No Yes

A self-hosted OSS instance is one operator per account. Public signup, if left on, creates a separate account, not a teammate. Invitations, users, teams, and permission roles ship with Cloud and Enterprise.

Enterprise licensing: sales@preloop.ai.

Community

Discord for help, feedback, and the founder's build log.

Contributing

See CONTRIBUTING.md.

The disposable capacity lab measures authenticated MCP, model-gateway and execution-log workloads using local simulated providers.

License

Apache License 2.0. Copyright (c) 2026 Spacecode AI Inc.

Maintainers: follow the protected-branch release process.

Release assets carry signed Sigstore build provenance and checksums. See verification instructions.

Windows CLI release binaries pass a required Defender scan and ten-minute observation before publication. Optional VirusTotal scanning and SignPath Authenticode signing provide additional release checks; signing is pending. windows-cli.md, windows-code-signing.md, code-signing-policy.md.

Free code signing provided by SignPath.io, certificate by SignPath Foundation.

Execution environment profiles and hosted checkpoint recovery are documented in Environments and recovery.

Operators can enable verified SSH and GCP agent deployment from the console. See remote agent deployment for host-key verification, dedicated cloud credentials, and proxy timeout configuration.

Cost links can carry an exact UTC start_date / end_date interval, with an optional account_id context. The console displays a Digest period without changing the saved preset. Account context is checked against the signed-in account; switching accounts and authentication retain the requested window.

Nanobot can run as a governed managed employee through the optional Nanobot integration, with bounded conversations and DeepSeek or another authorized model through Preloop.

Chat assistant connections for Slack, Mattermost, and Discord are described in Chat connections, including identity linking, scoped questions, approval votes, operator notes, and the separate durable worker (optional Helm chatWorker.enabled).

Ticket readiness reporting can be explicitly enabled with versioned project policies. See sampled ticket readiness for coverage, provenance and runtime requirements.

Restricted external runtime credentials (experimental)

Trusted provider adapters can exchange verified external session identity through preloop.models.crud.crud_restricted_runtime. Set PRELOOP_RESTRICTED_RUNTIME_CREDENTIALS=true explicitly to enable issuance and current-state authentication. The adapter must independently verify its provider identity and resolve an account-owned policy reference; this core primitive accepts no external bearer token. Operator policy uses the existing SecretReference, managed agent, validated enrollment and active policy snapshot.

Credentials expire within ten minutes and permit only approved external MCP server UUIDs and upstream tools. Ordinary REST, WebSocket, native control, builtin MCP tools and model gateway access remain denied. Tool calls require both MCP read and write scopes; read-only grants can list approved tools. Current policy generation, lifecycle, enrollment, key/session state and exact resource are rechecked before dispatch and after approval/connection waits. Async approval replay is unsupported for this credential mode.

A session receives its secret once. Retries, expiry, revocation, upstream-token refresh and policy re-enabling never mint a replacement for that same session. The adapter must commit the complete exchange transaction before delivering the secret. A failed delivery therefore requires a new authorized upstream session. Revocation uses the same policy row lock and preserves its tombstone. The policy reference retains at most 1,024 session records; reaching that ceiling denies new sessions without pruning revocation history. Rotation and archival workflows are future work. This experimental server/resource boundary does not attest the runner's executable, host or network origin.

Native runner flows and remote sessions support Devin CLI with managed MCP and native approval hooks. See remote sessions for setup and per-harness limits.

Run host Ollama and other loopback OpenAI-compatible servers through the gateway with runner-proxied local models. Discover them with preloop runner models and approve registration with --register.

Private runners also support explicit native host profiles for Codex, OpenCode and DeepSeek CLI (dsh) on Windows, macOS and Linux using locally authenticated CLIs. See native profile configuration and acceptance limits.

Chat setup discovers bot identities and named workspaces for Mattermost, Slack and Discord. Mattermost defaults to direct messages without a slash-command token. See Chat connections for worker setup and linking. Optional Cloud documentation support and human handoff use a separate EE service behind a console capability; self-hosted public pages do not load it by default.

Metadata

Release files for preloop 0.17.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 preloop 0.17.1
File Size Uploaded Provenance
preloop-0.17.1.tar.gz 4.7 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for preloop 0.17.1
File Interpreter ABI Platform
preloop-0.17.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 MB

Release files / preloop-0.17.1.tar.gz

Download URL preloop-0.17.1.tar.gz
Size 4.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4aa7f023141533aeb8e9425710bde5647d1975eba4896feaef4c7ee22e39d2a6
BLAKE2b-256 checksum
How to use checksums
70554cec20101af4fff56cef7243b4e2d1a27aa547d921d313a63de9f1e860f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / preloop-0.17.1-py3-none-any.whl

Download URL preloop-0.17.1-py3-none-any.whl
Size 5.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
896eb0af17e09d6d0932d53df9215adf0cfcaa181db3b22b82c21c22f6be2f7d
BLAKE2b-256 checksum
How to use checksums
5c39c8549fdb2cb9ec29e8b973f7d89e20c2a9f10bf35e38108e7f35975c3bf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for preloop 0.17.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

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