bray AGENTS.md

General instructions for a project that provides AI agents with Nostr identities through an MCP server and command-line tool. Nostr is a decentralised messaging protocol that uses cryptographic identities.

In plain words
What is it for?
Use it when developing or maintaining the Nostr agent server and CLI, including identity management, signing, relay connections, and trust verification.
Why use it?
It explains how to build, test, lint, and understand the project’s identity, signing, relay, and trust components.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/forgesworn/bray/agents-md
Clone the repo
git clone --depth 1 https://github.com/forgesworn/bray

Made for: Codex, OpenCode.

Per session 2,045 This file is loaded in full into every session.
When invoked 2,045 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02045 $0.02045
Opus 5 $0.01022 $0.01022
Sonnet 5 $0.00409 $0.00409
Haiku 4.5 $0.00204 $0.00204

Measured yesterday against content hash 8bc6eb18884a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bray AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — nostr-bray

Generic AI agent instructions. For Claude Code see CLAUDE.md, for Cursor see .cursorrules.

What this is

MCP server + CLI giving AI agents sovereign Nostr identities. 238 tools across 27 groups.

Build & Test

npm install
npm run build    # TypeScript → dist/
npm test         # ~1180 tests via vitest
npm run lint     # tsc --noEmit

Architecture

src/
  index.ts              MCP server entry point (tool registration + HTTP/stdio transport)
  cli.ts                CLI entry point (77 subcommands + shell REPL)
  catalog.ts            ActionCatalog — non-promoted tools, search-actions + execute-action meta-tools
  context.ts            IdentityContext — master key, LRU cache, derive, sign, zeroise
  trust-context.ts      TrustContext — verification (Signet) + proximity (WoT) + access (Dominion)
  signing-context.ts    SigningContext interface (local key or NIP-46 bunker)
  bunker-context.ts     NIP-46 BunkerContext + Heartwood extension probe
  config.ts             Secret loading from env/files, format detection
  relay-pool.ts         Relay connections, SOCKS5h proxy, Tor policy, write queue
  nip65.ts              NIP-65 relay list (signature-verified, TTL cache)
  validation.ts         Shared Zod validators (hexId, relayUrl, validatePublicUrl)
  format.ts             Human-readable CLI formatters
  help.ts               Per-command help with examples
  tool-response.ts      MCP output format helper (json/human)
  identity/             Identity tools (derive, prove, Shamir, NIP-05, migration)
  social/               Social tools (post, DM, blossom, groups, articles, badges, calendar…)
  trust/                Trust tools (attestations, ring sigs, spoken tokens)
  relay/                Relay tools (list, set, query, NIP-11 info, intelligence)
  zap/                  Zap tools (NWC wallet via NIP-47)
  safety/               Safety tools (duress persona, canary sessions/groups/beacons)
  util/                 Utility tools (decode, encode, verify, encrypt, filter, NIP browse)
  workflow/             Workflow tools (trust-score, feed-discover, verify-person, relay-health…)
  marketplace/          Marketplace tools (discover, pay, call, listings)
  privacy/              Privacy tools (ZK range/age/threshold proofs)
  moderation/           Moderation tools (labels, mute lists, pin lists, follow sets, bookmarks)
  signet/               Signet tools (badge, vouch, credentials, policy, challenge)
  vault/                Vault tools (Dominion epoch-based encrypted vaults)
  dispatch/             Dispatch tools (send, check, reply, ack, propose, capabilities)
  handler/              Handler tools (publish + discover NIP-90 DVMs)
  veil/                 WoT filter engine (no tools — internal scoring + cache)
  widgets/              Widget handlers (feed, DM thread, identity picker — no tools.ts)

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 134 lines · 2,045 tokens per session scan A 8bc6eb18884a

Subscribe to this mod's changes

bray AGENTS.md is an instructions file published in the GitHub repository forgesworn/bray (1 stars, last pushed 8d ago), licensed MIT. It adds 2,045 tokens to every session, about $0.0102 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.