Edge Connector

Edge Connector architecture

Learn how the Edge Connector evaluates calls: local checks, verdict caching, Fleet escalation over MQTT, HMAC-chained audit trail and OTA policy updates.

Preview. This page describes the Edge Connector, a Preview feature.

System overview

tool call + content
asks (socket, FFI)
records each decision
MQTT over TLS
verdicts, updates
AI agentPicoClaw, LangChain, …
Integration layeradapter, hook or MCP proxy
Edge Connector enginelibdclaw_core.so5 local checks + cache
Audit ringHMAC-chained, on flash
MQTT brokerTLS, per-device ACLs
Fleet gatewayverdict cache, policy push

List view for small screens. Use the expand button to open the drawing.

  1. AI agentPicoClaw, LangChain, …
    • tool call + contentIntegration layer
  2. Integration layeradapter, hook or MCP proxy
    • asks (socket, FFI)Edge Connector engine
  3. Edge Connector enginelibdclaw_core.so5 local checks + cache
    • records each decisionAudit ring
    • MQTT over TLSMQTT broker
  4. MQTT brokerTLS, per-device ACLs
    • verdicts, updatesFleet gateway
    • MQTT over TLSEdge Connector engine
  5. Audit ringHMAC-chained, on flash
  6. Fleet gatewayverdict cache, policy push
    • verdicts, updatesMQTT broker
AgentConnectorGatewayPolicy layerData store
A tool call goes from the agent through an integration layer to the engine. The engine decides locally and records every decision in the audit ring. When it cannot decide, it asks the Fleet gateway through the MQTT broker.
Text version of this diagram
  • AI agent: PicoClaw, LangChain, … (agent)
    • tool call + content to Integration layer
  • Integration layer: adapter, hook or MCP proxy (connector)
    • asks (socket, FFI) to Edge Connector engine
  • Edge Connector engine: libdclaw_core.so, 5 local checks + cache (policy layer)
    • records each decision to Audit ring
    • MQTT over TLS both ways with MQTT broker
  • MQTT broker: TLS, per-device ACLs (component). Used only when local policy cannot decide, and to deliver policy updates.
    • verdicts, updates both ways with Fleet gateway
  • Audit ring: HMAC-chained, on flash (data store)
  • Fleet gateway: verdict cache, policy push (gateway)

The integration layer maps tool_name to a capability, extracts the destination and content, sets the direction (request or response) and calls the engine over the Unix socket or the shared library. The engine returns ALLOW, BLOCK, WARN or PENDING.

Evaluation pipeline

Checks 1 to 5 are local and stop at the first block. Checks 6 and 7 decide what the local checks leave open.

Stage 1 — Input validation

Rejects malformed requests at the IPC boundary (IPC schema).

  • The request needs tool_name, its 64-character SHA-256 tool_hash, capabilities and session_id. destination is optional on the wire, but local policy requires it for network capabilities.
  • The engine checks that the hash matches the name, and replaces the caller's capabilities with its reviewed C mapping.
  • An unknown tool name is blocked before the verdict cache or a Fleet request. A custom tool name needs a reviewed C capability mapping; a Python adapter mapping alone does not authorize it.

Stage 2 — Rate limiting

Three independent token buckets, each refilled per minute. The limits are fixed in the build; policy cannot change them.

BucketDefaultControls
Tool calls60/minAll tool invocations
Network requests30/minNET_FETCH and SEND_MSG capabilities
Actuations10/minACTUATE capability (physical world)

When a bucket is empty, the verdict is BLOCK with reason RATE_LIMIT.

Stage 3 — Content scanning

When the request has a content field, the scanner runs built-in DFA and structural checks on it:

CategoryDetects
secretsAPI keys, tokens, private keys, passwords
piiSSN, credit cards, email addresses, phone numbers
credentialsAWS keys, GCP service accounts, database connection URIs
exfiltrationBase64-encoded blobs, hex dumps, data URI payloads
injectionPrompt injection, jailbreak attempts, system prompt overrides
commandsShell commands, SQL statements, code execution patterns
  • A finding at or above the built-in severity threshold blocks at once.
  • A scanner WARN does not change the final verdict; the request goes on to the next checks.
  • The direction field selects the content scope and severity threshold. The structural exfiltration check applies to request and user-input scope. The keyword patterns run in both directions.
  • The patterns are fixed in the build. OTA policy cannot configure them.

The C path has no local tool-hash deny list. The Fleet gateway checks tool hashes it receives over MQTT and blocks unknown hashes by default.

Stage 4 — Destination filtering + SSRF validation

For network capabilities the engine requires a destination, runs the SSRF checks first, then matches the compiled allowlist.

  • Hostname destinations are blocked on every build profile.
  • Only canonical public IPv4 or globally scoped IPv6 literals can reach the allowlist. Write an IPv6 entry without brackets; the policy compiler refuses a bracketed one. This parsing does not prove an address is routable.
  • Private and link-local addresses, numeric aliases (octal, hex or decimal forms) and malformed ports are blocked.
  • An unlisted destination is blocked with reason DEST_DENY. There is no destination_denylist.

The built-in SSRF check blocks:

  • private ranges (10.x, 172.16–31.x, 192.168.x, 127.x);
  • cloud metadata endpoints (169.254.169.254, metadata.google.internal);
  • link-local addresses (fe80::/10).

Stage 5 — Sequence correlation

A finite state machine tracks capability calls per session. When a configured dangerous sequence completes, for example net_fetch then exec_shell, the verdict is BLOCK with reason CAP_SEQUENCE. The policy compiler builds the tables from the policy's capability_sequences (Capability sequences).

Stage 6 — Verdict cache

An in-memory LRU cache holds Fleet verdicts, keyed by the 32-byte tool hash alone. A cache hit saves a Fleet request; the local checks above have already run.

  • The Fleet verdict carries a TTL in minutes. Zero removes any earlier entry for the tool and is not cached.
  • The device caps the TTL at 60 minutes for ALLOW, seven days for BLOCK and four hours for WARN.
  • Entries expire on the monotonic clock, not wall-clock time. Policy YAML cannot set these TTLs.

Stage 7 — Fleet escalation

When local policy cannot decide, the device sends a verdict request to the Fleet gateway over MQTT 3.1.1. The request carries:

  • the tool hash, a shortened tool name, the capability and the destination;
  • a truncated content snippet (up to DCLAW_ESCALATION_PAYLOAD_MAX);
  • session risk and capability metadata, and request nonces.

The gateway decides by tool hash through its verdict cache. It does not send the snippet or destination to a separate model, and it blocks unknown hashes by default. The findings wire field is a zero placeholder.

ModeWhile waitingOn timeout or publish failure
sync_blockThe call is blocked until a verdict arrives.Stays blocked.
speculativeThe call can run at once.Already ran; a later BLOCK cannot undo it.

Choose the mode by the consequence of the tool call (capability mapping).

Audit trail

An HMAC-chained ring in flash records compact decisions. Each entry holds:

  • a monotonic tick timestamp, the session ID and a 32-bit prefix of the tool hash;
  • the action and reason;
  • a 16-byte HMAC tag chained to the entry before it.

The ring does not store full tool names, capabilities or content findings. The chain detects changes within the retained history. Non-BLOCK entries are buffered to save flash writes. BLOCK entries are written at once, and kept in RAM for a retry when a write fails and space remains.

Cloud components

The fleet management and verdict cache run as Go services alongside the main DefenseClaw gateway:

ComponentPathDescription
Fleet Managerinternal/fleet/manager/Device registry, heartbeat, anomaly detection
Verdict Cacheinternal/fleet/verdict/LRU verdict cache with TTL
REST APIinternal/fleet/api.go/api/v1/fleet/ endpoints
Metricsinternal/fleet/metrics.goPrometheus metrics for fleet health

OTA policy updates

Policy updates arrive over MQTT. A production build accepts an HMAC-signed update only when built with DCLAW_ALLOW_HMAC_OTA=ON and given a separate HMAC key (DCLAW_OTA_HMAC_KEY).

ProtectionWhat it does
HMAC-SHA256 signatureEvery update is signed.
Anti-rollbackA monotonic version counter refuses a downgrade.
Local canary windowEach device watches its block rate for ten minutes and can restore its previous policy after a sustained spike (Canary deployment).
Replay protectionA duplicate or out-of-order update is refused.