Skip to main content

Universal gating and audit layer for AI agents — policy-based tool gating with WebAuthn approval flows

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latch_agent-0.2.0.tar.gz (19.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latch_agent-0.2.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file latch_agent-0.2.0.tar.gz.

File metadata

  • Download URL: latch_agent-0.2.0.tar.gz
  • Upload date:
  • Size: 19.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for latch_agent-0.2.0.tar.gz
Algorithm Hash digest
SHA256 12b7f5f073799dbe2855db67fd5c5b51021e1b25da52900b3dbfdd55bba75570
MD5 2db6d0073ab8976c7505f3a0c1e3e981
BLAKE2b-256 ce5098c36ab52ff87c5dc6664f0ed446d56dd50a2552f2699e127dadc3a3fafc

See more details on using hashes here.

File details

Details for the file latch_agent-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for latch_agent-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abd1e76e841050b5ece540f4b5c214875e8795632ad7af8e3e5edad06b70dcf5
MD5 39ab465c6afd5c72f3a04e48a5ce5d9c
BLAKE2b-256 3771c78d0b993dfb5fafaa8613b91d7acf9edc151b5d10bb6cd6153675acabfb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page