Benjamin Kurrek 2d64363101 fix(qa): stop the agent asserting unverified state — automation status, per-caller extension auth, recalled memory (#7246, #7247, #7294) (#7474)
* fix(assistant): ground automation-status claims in actual state checks (#7246)

The agent confidently reported a BTC-news-digest automation as running and
delivering to Telegram while the Automations page showed "No automations
yet" — status fabricated from conversation history instead of checked.

The read path already exists: builtin.trigger_list is model-callable
(PermissionMode::Allow), core-tier always-advertised, granted in the
interactive policy, and deliberately retained for scheduled fires. The
failure is grounding: its description said only "List scheduled triggers
owned by the current caller scope" — no bridge from the user vocabulary
("automation", the Automations page; "routine") to the trigger capability,
and no instruction to consult it before asserting status.

Mechanism (mirrors the proven builtin__outbound_delivery_targets_list
grounding pattern — description-level positive rule tied to the exact
assertion the model must not fabricate):

- trigger_management.rs: TRIGGER_LIST_DESCRIPTION now names the surface
  ("the automations shown on the Automations page"), declares the listing
  the authoritative current state, instructs calling it before answering
  which routines/automations exist or saying one is running, paused,
  already set up, delivering, or missing, forbids reporting status from
  conversation history or memory, and grounds the empty result as "the
  caller has no routines".
- schemas.rs: trigger_list.input.v1.json gains a root description carrying
  the same authoritative-state framing into the model-visible schema.

Regression test (red on the old description, green now):
builtin_trigger_list_surface_grounds_automation_status_claims in
first_party_builtin_tools.rs, driven through the production
visible_capabilities surface assembly — not the constant — asserting the
vocabulary bridge, the check-before-assert rule, the memory ban, the
empty-state grounding, and the schema root description.

Validated: ironclaw_host_runtime suite + clippy -D warnings green;
ironclaw_loop_host, ironclaw_turn_runner, ironclaw_composition green;
reborn_group_triggers integration group green, proving the new description
survives the prompt-build descriptor validation chain (VerifiedCatalog
surface, 4096-byte cap) under production wiring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(memory): frame recalled memory as recollection, not live state; pin cross-thread transcript containment (#7294)

Investigation verdict: the reported "agent remembers a Telegram routine
from another scope or thread" is NOT a retrieval leak. Every isolation
seam holds: providers scope-filter (native retains only scope-equal
results and excludes threads/ scratch from the long-term lane; mem0
partitions by the composed user namespace), and the host re-applies the
ExpectedScope drop filter in ironclaw_host_runtime::memory_context.
Durable memory crossing conversations for the same user is the
contract's design. The defect is presentation: recalled snippets entered
the prompt as bare "Untrusted memory content: ..." system messages, so
the model read a recollection ("user asked for a BTC news routine") as
verified current state ("you already have this set up").

Fix, at the prompt-assembly seam (InstructionBundleBuilder): whenever at
least one memory snippet is admitted, the memory section now opens with
a recall-framing system message (prompts/memory_recall_framing.md,
include_str!) telling the model these are recollections from earlier
turns/conversations that describe past state and must be verified with a
tool before being asserted as currently configured. No rows are
filtered, deleted, or re-scoped.

Regression coverage making the scoping contract explicit (all green
today; sabotage-verified to arm):
- shared conformance suite (ironclaw_memory::test_support, runs for
  native + mem0): a recorded conversation transcript is invisible to
  another thread's short-term AND long-term lanes and to thread-less
  (trigger-shaped) long-term retrieval; durable memory written during
  one conversation stays retrievable from another (cross-thread recall
  is by design, not a leak).
- instruction-bundle unit tests: framing precedes the snippets; absent
  when no snippets are admitted.
- scenario_proactive_prompt_recall_libsql (production wiring, libSQL):
  the writer conversation's after-turn transcript (proven recorded via
  its own short-term lane) never surfaces in the reader conversation's
  prompt, and recalled durable memory arrives behind the framing.

Consumer contract tests in ironclaw_turns / ironclaw_loop_host updated
for the new memory-section header; tests/CLAUDE.md coverage row updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(assistant): communication context reports per-caller credential truth (#7247)

The model-facing communication runtime context asserted connection state it
never verified: RuntimeCommunicationContextProvider hard-coded
`authenticated: true` for every host-Active channel-surface extension, and
carried no per-caller credential truth at all for credentialed tools-only
extensions (the GitHub repro — the model saw 49 github.* tools plus
"installed and active" catalog state and told the user no further connection
was required, right before the next call raised Authentication required).

Mechanism:

- ironclaw_assistant: the provider now takes the existing readiness ports —
  ExtensionCredentialSetupService (the same scope-gated credential_status the
  extensions card and the runtime auth gate resolve through) and
  ironclaw_auth::ChannelConnectionService — and classifies each Active
  installed extension with a new shared caller_extension_auth verdict in
  reborn_services/extensions.rs. The extensions card's channel-unconnected
  computation is extracted into caller_channel_connection and reused by both
  paths, so the card and the prompt can never diverge on "connected for this
  caller".
- Channels: `authenticated` is now the per-caller truth. A channel needing a
  personal OAuth/pairing binding with no proof for this caller renders
  "unauthenticated"; a genuinely paired/connected channel (or one requiring
  no personal binding, e.g. admin-managed) still renders "authenticated" —
  the #6478 truthful positive is preserved and pinned.
- ironclaw_loop_contracts: CommunicationRuntimeContext gains
  PendingExtensionAuthState; a bounded, sanitized render line names installed
  extensions the calling user has NOT authenticated and forbids the
  "already connected" claim. Unknown/empty render nothing.
- Fail-closed: when a needed verdict is unknowable (ports unwired, lookup
  failed, budget expired) both states degrade to Unknown — the slice claims
  nothing in either direction. Tools stay visible; the auth gate still owns
  enforcement at dispatch.
- ironclaw_composition: wires ProductAuthExtensionCredentialSetup and the
  generic channel-connection facade (assembly extracted into
  build_generic_channel_connection_facade, shared with the product surface)
  into the provider.
- Architecture: ironclaw_loop_contracts size ceiling raised 13112 -> 13172
  for the declaration/render vocabulary (reason recorded at the ceiling).

Regression tests: communication_context::tests
{active_channel_requiring_connection_is_not_claimed_authenticated_without_proof,
credentialed_tool_extension_without_caller_credential_is_pending_auth,
credentialed_tool_extension_with_expired_credential_is_pending_auth,
oauth_channel_not_connected_by_caller_reads_unauthenticated,
oauth_channel_connected_by_caller_reads_authenticated,
credentialed_extension_without_credential_port_degrades_to_unknown} plus
render pins in ironclaw_loop_contracts runtime_context/tests.rs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(arch): re-measure loop_contracts size ceiling for the #7247+#7294 union

Each fix measured the ceiling alone against main (#7247 raised it to
13,172 for its additions); batching both crate-growing commits onto one
branch requires the union measurement, 13,306 — read from the gate's own
failure message, pinned exactly per the #7147 no-untracked-slack lesson.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(ci): raise composition arc_dyn ceiling 814 -> 816 for the #7247 context-provider ports

Two genuine dyn seams (ExtensionCredentialSetupService + the channel-
connection facade) wired into communication-context assembly; observed
831 sites, effective ceiling re-pinned to exactly that — no slack.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* review: apply the 8 CodeRabbit findings (#7474)

- memory_recall_framing: tool results are authoritative for tool-queryable
  current state; conversation text no longer outranks a fresh tool result.
- trigger_list: limit 0 rejected (schema minimum: 1) so an empty result is
  always proof of absence; regression tests at the handler and the
  boundary suite (the old boundary test pinned the buggy empty-success).
- runtime_context: worst-case SafeSummary fixture now saturates the
  pending-auth arm (fits within 4 KiB); byte-budget truncation test added.
- agent_loop_host_contract: recall-framing filter keyed by content_ref.
- communication_context: per-extension credential lookups run under
  bounded concurrency (8, matching the extensions card) instead of
  serially inside the 500 ms budget; account-backed unconnected test
  (expired / refresh-failed rows read unauthenticated).
- composition-budget: arc_dyn_observed re-measured to 831 with the
  rationale corrected (observed == effective ceiling exactly).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 02:02:55 +00:00

IronClaw

IronClaw

Your secure personal AI assistant, always on your side

License: MIT OR Apache-2.0 Telegram: @ironclawAI Reddit: r/ironclawAI gitcgr

English | 简体中文 | Русский | 日本語 | 한국어

Quick StartPhilosophyFeaturesInstallationConfigurationSecurityArchitecture


Quick Start

Choose an ironclaw-v* tag from the Releases page, then install it on macOS, Linux, or Windows/WSL. Replace X.Y.Z with the selected version, including any prerelease suffix:

IRONCLAW_RELEASE_TAG=ironclaw-vX.Y.Z
curl --proto '=https' --tlsv1.2 -LsSf \
  "https://github.com/nearai/ironclaw/releases/download/${IRONCLAW_RELEASE_TAG}/ironclaw-installer.sh" | sh

Then run the guided setup:

ironclaw onboard

Choose an LLM provider, enter its API key in the hidden prompt, and accept the default model or enter another one. IronClaw provisions its local configuration, encrypted credential store, and WebUI login token. On macOS and Linux it also installs and starts the background service, then prints a link that opens the WebUI.

Use ironclaw status to check the service and print the login link again. Windows users can start the WebUI in the foreground with ironclaw serve. See Installation for Windows installers and source builds.

Philosophy

IronClaw is built on a simple principle: your AI assistant should work for you, not against you.

In a world where AI systems are increasingly opaque about data handling and aligned with corporate interests, IronClaw takes a different approach:

  • Your data stays yours - All information is stored locally, encrypted, and never leaves your control
  • Transparency by design - Open source, auditable, no hidden telemetry or data harvesting
  • Self-expanding capabilities - Build new tools on the fly without waiting for vendor updates
  • Defense in depth - Multiple security layers protect against prompt injection and data exfiltration

IronClaw is the AI assistant you can actually trust with your personal and professional life.

Features

Security First

  • WASM Sandbox - Untrusted tools run in isolated WebAssembly containers with capability-based permissions
  • Credential Protection - Secrets are never exposed to tools; injected at the host boundary with leak detection
  • Prompt Injection Defense - Pattern detection, content sanitization, and policy enforcement
  • Endpoint Allowlisting - HTTP requests only to explicitly approved hosts and paths

Always Available

  • Multi-channel - REPL, HTTP webhooks, WASM channels (Telegram, Slack), and web gateway
  • Docker Sandbox - Isolated container execution with per-job tokens and orchestrator/worker pattern
  • Web Gateway - Browser UI with real-time SSE/WebSocket streaming
  • Routines - Cron schedules, event triggers, webhook handlers for background automation
  • Heartbeat System - Proactive background execution for monitoring and maintenance tasks
  • Parallel Jobs - Handle multiple requests concurrently with isolated contexts
  • Self-repair - Automatic detection and recovery of stuck operations

Self-Expanding

  • Dynamic Tool Building - Describe what you need, and IronClaw builds it as a WASM tool
  • MCP Protocol - Connect to Model Context Protocol servers for additional capabilities
  • Plugin Architecture - Drop in new WASM tools and channels without restarting

Persistent Memory

  • Hybrid Search - Full-text + vector search using Reciprocal Rank Fusion
  • Workspace Filesystem - Flexible path-based storage for notes, logs, and context
  • Identity Files - Maintain consistent personality and preferences across sessions

Installation

The Releases page provides pre-built binaries and installers.

Install via Windows Installer (Windows)

Open the selected ironclaw-v* release, download ironclaw-x86_64-pc-windows-msvc.msi, and run it.

Install via PowerShell script (Windows)
$IronClawReleaseTag = "ironclaw-vX.Y.Z"
irm "https://github.com/nearai/ironclaw/releases/download/$IronClawReleaseTag/ironclaw-installer.ps1" | iex
Install via shell script (macOS, Linux, Windows/WSL)
IRONCLAW_RELEASE_TAG=ironclaw-vX.Y.Z
curl --proto '=https' --tlsv1.2 -LsSf \
  "https://github.com/nearai/ironclaw/releases/download/${IRONCLAW_RELEASE_TAG}/ironclaw-installer.sh" | sh
Build and install from source

Source builds require Rust 1.96+ and Node.js 22+ with Corepack/pnpm.

git clone https://github.com/nearai/ironclaw.git
cd ironclaw
corepack enable pnpm
cargo install --locked --path crates/app/ironclaw_cli

Configuration

ironclaw onboard is the primary configuration path. It writes Reborn state under $HOME/.ironclaw/reborn by default, stores the selected LLM credential in the encrypted local secret store, and preserves existing configuration when it is run again.

Inspect the current setup with:

ironclaw status
ironclaw models status
ironclaw config list

To switch providers after onboarding, select the route and then store its API key using the hidden prompt:

ironclaw models set-provider openai --model gpt-5-mini
ironclaw config set openai.api_key

Additional settings use the same command. For example:

ironclaw config set google.client_id YOUR_CLIENT_ID
ironclaw config set google.client_secret
ironclaw config set google.redirect_uri YOUR_REDIRECT_URI
ironclaw config set webui.token --rotate

Secret values never accept a positional argument; IronClaw prompts for them without echoing the value. Channels such as Slack and Telegram have no configuration-file settings and no CLI enablement key: install the extension and complete its setup on the WebUI Extensions page, which is what makes the route serve.

Configuration writes never restart the service automatically. Run ironclaw service restart after a change that affects the running service, and use ironclaw config set --help for the complete list of supported keys.

Security

IronClaw implements defense in depth to protect your data and prevent misuse.

WASM Sandbox

All untrusted tools run in isolated WebAssembly containers:

  • Capability-based permissions - Explicit opt-in for HTTP, secrets, tool invocation
  • Endpoint allowlisting - HTTP requests only to approved hosts/paths
  • Credential injection - Secrets injected at host boundary, never exposed to WASM code
  • Leak detection - Scans requests and responses for secret exfiltration attempts
  • Rate limiting - Per-tool request limits to prevent abuse
  • Resource limits - Memory, CPU, and execution time constraints
WASM ──► Allowlist ──► Leak Scan ──► Credential ──► Execute ──► Leak Scan ──► WASM
         Validator     (request)     Injector       Request     (response)

Prompt Injection Defense

External content passes through multiple security layers:

  • Pattern-based detection of injection attempts
  • Content sanitization and escaping
  • Policy rules with severity levels (Block/Warn/Review/Sanitize)
  • Tool output wrapping for safe LLM context injection

Data Protection

  • All data stored locally in IronClaw's application state
  • Secrets encrypted with AES-256-GCM
  • No telemetry, analytics, or data sharing
  • Full audit log of all tool executions

Architecture

┌────────────────────────────────────────────────────────────────┐
│                          Channels                              │
│  ┌──────┐  ┌──────┐   ┌─────────────┐  ┌─────────────┐         │
│  │ REPL │  │ HTTP │   │WASM Channels│  │ Web Gateway │         │
│  └──┬───┘  └──┬───┘   └──────┬──────┘  │ (SSE + WS)  │         │
│     │         │              │         └──────┬──────┘         │
│     └─────────┴──────────────┴────────────────┘                │
│                              │                                 │
│                    ┌─────────▼─────────┐                       │
│                    │    Agent Loop     │  Intent routing       │
│                    └────┬──────────┬───┘                       │
│                         │          │                           │
│              ┌──────────▼────┐  ┌──▼───────────────┐           │
│              │  Scheduler    │  │ Routines Engine  │           │
│              │(parallel jobs)│  │(cron, event, wh) │           │
│              └──────┬────────┘  └────────┬─────────┘           │
│                     │                    │                     │
│       ┌─────────────┼────────────────────┘                     │
│       │             │                                          │
│   ┌───▼─────┐  ┌────▼────────────────┐                         │
│   │ Local   │  │    Orchestrator     │                         │
│   │Workers  │  │  ┌───────────────┐  │                         │
│   │(in-proc)│  │  │ Docker Sandbox│  │                         │
│   └───┬─────┘  │  │   Containers  │  │                         │
│       │        │  │ ┌───────────┐ │  │                         │
│       │        │  │ │Worker / CC│ │  │                         │
│       │        │  │ └───────────┘ │  │                         │
│       │        │  └───────────────┘  │                         │
│       │        └─────────┬───────────┘                         │
│       └──────────────────┤                                     │
│                          │                                     │
│              ┌───────────▼──────────┐                          │
│              │    Tool Registry     │                          │
│              │  Built-in, MCP, WASM │                          │
│              └──────────────────────┘                          │
└────────────────────────────────────────────────────────────────┘

Core Components

Component Purpose
Agent Loop Main message handling and job coordination
Router Classifies user intent (command, query, task)
Scheduler Manages parallel job execution with priorities
Worker Executes jobs with LLM reasoning and tool calls
Orchestrator Container lifecycle, LLM proxying, per-job auth
Web Gateway Browser UI with chat, memory, jobs, logs, extensions, routines
Routines Engine Scheduled (cron) and reactive (event, webhook) background tasks
Workspace Persistent memory with hybrid search
Safety Layer Prompt injection defense and content sanitization

Usage

# Check the background service and print the WebUI login link
ironclaw status

# Start an interactive terminal session
ironclaw repl

# Run one turn
ironclaw run --message "hello"

Development

# Format code
cargo fmt

# Lint
cargo clippy --all --benches --tests --examples --all-features

# Run tests
createdb ironclaw_test
cargo test

# Run specific test
cargo test test_name

OpenClaw Heritage

IronClaw is a Rust reimplementation inspired by OpenClaw. See FEATURE_PARITY.md for the complete tracking matrix.

Key differences:

  • Rust vs TypeScript - Native performance, memory safety, single binary
  • WASM sandbox vs Docker - Lightweight, capability-based security
  • PostgreSQL vs SQLite - Production-ready persistence
  • Security-first design - Multiple defense layers, credential protection

License

Licensed under either of:

at your option.

Description
IronClaw is OpenClaw inspired implementation in Rust focused on privacy and security IronClaw 基于一个简单的原则:你的 AI 助手应该为你服务,而不是与你为敌。
Readme 1.8 GiB
Languages
Rust 86%
Python 7.5%
JavaScript 3.4%
Shell 1.9%
CSS 0.9%
Other 0.2%