Skip to main content

latch-agent

Universal gating and audit layer for AI agents. Intercepts tool calls, evaluates them against YAML policies, logs decisions, and supports WebAuthn approval flows.

Quick Start

curl -fsSL https://raw.githubusercontent.com/dipakkrishnan/latch/main/scripts/install-latch.sh | sh
latch setup

Alternative:

pipx install latch-agent
latch setup

OpenClaw Integration

openclaw plugins install openclaw-latch

The plugin automatically installs latch-agent, runs latch init, and registers latch-serve as an MCP server.

Claude Code Integration

Add latch as a hook in your Claude Code settings:

{
  "hooks": {
    "PreToolUse": [{ "command": "latch-hook" }]
  }
}

Codex Integration

Set up latch as a pre-tool-use hook in your Codex configuration, pointing to latch-hook.

Policy Format

Edit ~/.agent-2fa/policy.yaml:

defaultAction: allow
rules:
  - match: { tool: Bash }
    action: ask
  - match: { tool: 'Edit|Write|NotebookEdit' }
    action: ask
  - match: { tool: 'Read|Glob|Grep' }
    action: allow

Actions: allow, deny, ask, browser (browser-based approval), webauthn (passkey required).

Configuration

Variable Default Description
AGENT_2FA_DIR ~/.agent-2fa Config directory path
AGENT_2FA_CLIENT auto-detected Override client detection
LATCH_HOOK_DEBUG false Enable debug logging for hook mode

CLI Commands

latch init       # Initialize config directory
latch hook       # Run as stdin/stdout hook
latch serve      # Run as MCP proxy server
latch dashboard  # Launch web dashboard
latch enroll     # Enroll a WebAuthn passkey
latch setup      # Guided setup wizard
latch status     # Show config summary

Development

cd py
uv sync
uv run pytest

Metadata

Release files for latch-agent 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for latch-agent 0.2.0
File Size Uploaded Provenance
latch_agent-0.2.0.tar.gz 19.2 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for latch-agent 0.2.0
File Interpreter ABI Platform
latch_agent-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 MB

Release files / latch_agent-0.2.0.tar.gz

Download URL latch_agent-0.2.0.tar.gz
Size 19.2 MB
Tags Source
SHA-256 checksum
How to use checksums
12b7f5f073799dbe2855db67fd5c5b51021e1b25da52900b3dbfdd55bba75570
BLAKE2b-256 checksum
How to use checksums
ce5098c36ab52ff87c5dc6664f0ed446d56dd50a2552f2699e127dadc3a3fafc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.2

Release files / latch_agent-0.2.0-py3-none-any.whl

Download URL latch_agent-0.2.0-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abd1e76e841050b5ece540f4b5c214875e8795632ad7af8e3e5edad06b70dcf5
BLAKE2b-256 checksum
How to use checksums
3771c78d0b993dfb5fafaa8613b91d7acf9edc151b5d10bb6cd6153675acabfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.2

Security for latch-agent 0.2.0

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.

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