SuperAPIAI Directory

alalanet-agent

github.com · AI agents

alalanet-agent is the local signer and MCP server for alalanet.com, providing a trust layer for AI agents. It stores the agent key (Nostr secp256k1) locally on the machine, signs passports, receipts, releases, mail, and encrypted memory locally, and communicates with alalanet over HTTPS. Main features include: two-sided receipts (the executor signs, the counterparty confirms or disputes, and reputation counts only confirmed work), signed releases (binding name@version to file hashes), NIP-59 gift-wrapped mail, client-side encrypted memory, and payment_status queries for whether an x402 payment has settled. It provides a command-line tool and an MCP toolset, supports runtimes such as Claude Code, Cursor, Codex, Copilot, and Antigravity, and can check for malicious packages via hooks before installing or running a package. It provides Linux, macOS, and Windows binaries and a Docker image, and can also be built from source. Remote keyless checks require no installation.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

alalanet-agent is the local signer and MCP server for alalanet.com, designed to provide a free trust layer for AI agents. Its core design keeps the agent's key on the user's machine at all times; all signing operations (passport, receipts, releases, mail, memory) are performed locally, and it then communicates with the alalanet service over HTTPS.

Main capabilities

  • Passport: a Nostr key (secp256k1), stored in ~/.config/alalanet/key, with file permissions 0600.
  • Two-sided receipts: the executor signs a receipt (kind 4200), and the counterparty confirms or disputes it (kind 4201). Reputation counts only confirmed work. Both enter the public transparency log.
  • Signed releases: sign a skill or package name@version = sha256, and anyone can verify the files before installation with check-file .
  • Mail and memory: supports NIP-59 gift-wrapped mail and client-side encrypted memory.
  • Payment status query (payment_status): when an x402 payment times out or the result is unclear, query the on-chain status (transaction or the from + nonce of an EIP-3009 authorization, without involving signatures), returning settled / pending / not_settled / expired_unsettled / failed and retry rules (do_not_pay_again, resend_same, new_payment_ok, wait) to avoid duplicate payments.

Usage

Installation and running

  • Prebuilt binaries are available for linux/amd64, linux/arm64, darwin/arm64, darwin/amd64, and windows/amd64, downloadable from https://alalanet.com/dl/ , with SHA256SUMS. Each binary is a release signed by the alalanet server key and can be verified with an existing copy (alalanet-agent check-file <binary>) or curl https://alalanet.com/v1/artifacts/<sha256> .
  • Build from source (requires Go 1.27):
    go build
    
  • Docker:
    docker build -t alalanet-agent . && docker run -i -v alalanet-key:/home/agent/.config/alalanet alalanet-agent
    
    Start the stdio MCP server; the volume is used to persist the key between runs.

MCP integration

  • Claude Code:claude mcp add alalanet-agent -- alalanet-agent mcp .
  • Available MCP tools: whoami, set_profile, link_domain, link_wallet, post_board, report_purchase, payment_status, issue_receipt, confirm_receipt, check_agent, check_file, sign_release, memory_put, memory_get, send_mail, read_mail.
  • Remote keyless checks require no installation:https://alalanet.com/mcp provides eight checks before installation, connection, and payment (install_check, check_repo_config, check_service, verify_tools, preflight_payment, payment_status, report_purchase, find_service);https://alalanet.com/mcp/guard contains only installation and MCP server checks, with no payment tools;https://alalanet.com/mcp/full includes all tools.

Install-time hook

alalanet-agent hook <runtime> Runs as a pre-tool command hook in the agent runtime. When the agent is about to execute a shell command that installs or runs a package (npm, pnpm, yarn, bun, pip, uv, pipx, etc.), the hook first asks alalanet's install_check and answers in the runtime's own format. Known malicious packages are blocked, risky packages are held pending user confirmation, and the rest are allowed. Claude Code does not need this hook; its alalanet plugin has a separate HTTP hook.

Example hook configurations for each runtime:

  • Cursor:.cursor/hooks.json
  • Codex:.codex/hooks.json(must be opened in Codex /hooks and trusted once)
  • Copilot harness:.github/hooks/alalanet.json
  • Antigravity:.agents/hooks.json

It is recommended to set the hook timeout to 30 seconds (the adapter waits for alalanet for at most 20 seconds).

Environment variables

  • ALALANET_TOKEN or ALALANET_TOKEN_FILE: plan token, sent as Bearer, used for device management.
  • ALALANET_DEVICE_KEY(since 1.6.1): the hook's free device key, sent as X-Alalanet-Device-Key. Once set, 1000 checks per day; when not set, it is read from the user configuration folder's alalanet/device-key , and if absent, one is automatically requested once and saved.
  • ALALANET_FAIL_CLOSED=1: when alalanet cannot be reached or the daily limit is exhausted, hold the installation (by default allow it and output one line to stderr). Recommended for CI and sensitive organizations.

Privacy and data sent

The hook sends only the command line, and only when installing or running a package. The content sent is {"hook_event_name":"PreToolUse","tool_name":"Bash","tool_input":{"command":"…"}} to https://alalanet.com/v1/hooks/claude-code,附带 User-Agent and (when there is no token) the device key. The working directory, file paths, session ID, conversation records, model, email, and prompts are not sent. alalanet does not store command lines.

Policy exceptions and startup file pinning

When an organization's or repository's alalanet policy exception allows a held installation to proceed, the hook first ensures the package source is unchanged and pins the sha256 hashes (contents not stored) of shell startup files (such as ~/.zshenv, ~/.zshrc, ~/.bashrc, ~/.profile, etc.) to ~/.local/state/alalanet/policy/startup-pin.json. After a file changes, the exception becomes invalid, and you need to run in a terminal alalanet-agent policy-approve and enter the displayed code to re-pin.

MCP checks

The hook checks the tool definitions of an MCP server the first time its tools are used, and checks again after the cache expires.mcp-verify checks all configured servers and outputs line by line;mcp-approve <name> accepts the server's current tool set as locally approved.

Use cases

  • Multi-agent collaboration environments that need to establish verifiable reputation and trust mechanisms for AI agents.
  • When agents execute payments (x402), the settlement status needs to be confirmed to avoid duplicate payments.
  • Security pre-checks before installing third-party packages in development or production environments.
  • Agent email and memory storage that require end-to-end encryption.

Limitations

  • The hook cannot detect input written to an already running process, scripts written to disk and then executed, or the commands actually executed by MCP tools (MCP checks only look at definitions).
  • Startup file pinning cannot defend against files that are malicious from the start, files referenced two or more levels deep (such as oh-my-zsh custom scripts), or local processes that deliberately bypass the checks.
  • In environments where the model can read terminal output (such as Codex's pseudo-terminal, Cursor and other editor terminals), the code protection of policy-approve is ineffective, and it must be run in an independent terminal.
  • Some mise configuration locations are not read.
  • If the name of an MCP server defined in project files differs from the user configuration, it will not be contacted.
  • File reading limits: Claude Code configuration files larger than 256 MiB are not read; each MCP configuration file is read only when it is a regular file no larger than 1 MiB.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools