Skip to content

[MOCA SBX] Run body-reading plugins (IBAC, SPARC, tool-prune) under a streaming contract #1487

Open

Description

@pdettori

Priority: P3 · Part of the Cortex × MOCA SBX epic · Not in #905's breakdown · This is the reason MOCA would move from moca-egress to Cortex

Problem

MOCA's contract streams bodies and never buffers them, to keep less decrypted data on the host and less code on the critical path. The Cortex plugins MOCA wants most, ibac, sparc, tool-prune and context-guru, read bodies.

Two further constraints:

  • Plugins see only intercepted traffic. MOCA intercepts only hosts with a credential, plus an opt-in inspect list, so every plugin's hosts must be on that list.
  • IBAC needs the user's intent. That is the last thing the user asked for, and today it is extracted from inbound A2A messages and read from pctx.Session.LastIntent() (ibac/plugin.go:464). In SBX the intent lives on the harness side and would have to arrive over the control channel (issue 2).

Design questions

  1. Per-host opt-in buffering, with a size cap and a named refusal when it is exceeded?
  2. The intent channel: a control message alongside Rebind, or a separate feed?
  3. Latency budget per tool call. SBX's warm Exec is about 53 ms, so a judge call adds a measurable fraction.

Done when

ibac runs on an intercepted, inspect-listed host in the MOCA profile with an intent delivered over the control channel. Streaming hosts are unaffected.

Activity

  1. added
    enhancement
    on Oct 22, 2026
  2. huang195 commented on Nov 23, 2026

    @huang195
    Member

    Grounding review on 2026-11-23 (moca main e464dd6, Cortex main 7f3eec7):

    • moca has no inspect list. MOCA_EGRESS_INSPECT is in MI1 §15 but not in the code. moca intercepts a connection only when a credential applies (remote-worker/internal/egress/handler.go:239-260). So a body plugin on this role sees only intercepted hosts, unless a new, general setting selects more hosts.
    • The IBAC line that this issue cites moved to :451.
    • On the sandbox service, the user's prompt is in Claude Code on the laptop, not in the guest. That is D12 in design: A general multi-tenant egress core in Cortex, with moca's code behind one build tag #2042.

    Assisted-By: Claude (Anthropic AI) [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions