Skip to content

NEAR tools: qualify encrypted field coverage and preserve the current tool boundary #73

Open

Description

@amiller

Abalone avoids content-only E2EE tool leaks by carrying tool definitions, requests and results inside encrypted message text and running tools locally. This protection must remain in place. The actual problem is that source comments/UI describe this as a universal NEAR limitation, while NEAR now documents an opt-in all-fields encrypted protocol. Native tools remain unqualified in this integration; the custom bridge also has user-visible reliability failures tracked in #56 and #52.

Current hosted-main evidence: agents/pi/near-provider.ts strips tools and refuses structured history; lib/intools.mjs implements encrypted-text tool requests; lib/coupon-near.mjs refuses structured response tool calls. The ordinary provider decoder only decrypts content/reasoning fields and does not itself reject structured response calls: audit that asymmetry before any native-tool enablement.

Upstream evidence: https://github.com/nearai/nearai-cloud-verifier/blob/main/py/encrypted_agent_loop_verifier.py requires X-Encrypt-All-Fields:true and encryption version 2; documents tool fields and in-CVM web search, with query disclosure to Brave. The example fetches a key from an attestation report, so its existence alone does not establish client verification of the key or deployment qualification.

Sprint 1: document the exact current boundary, replace universal source claims with integration-specific wording, and add synthetic negative coverage for native request history/response calls and positive encrypted-text tool round trips. Clarify that local tools still run. No provider protocol switch in this sprint.

Sprint 2 (depends on source/deployment qualification): establish supported models/versions, verify keys before encryption, cover schemas/history/streamed names+arguments/reasoning/results in both directions, reject plaintext/downgrades and test response integrity. Only then consider replacing the custom parser through #56/#48. Tool destination disclosure remains a separate policy.

Acceptance: no sensitive native fields leave the client unencrypted; no unsupported native calls execute; valid encrypted-text tool use remains available; docs distinguish local tool execution from external-service disclosure; checks name their evidence limits. Follow the independent review/offline gates before runtime integration. No real transcripts or unbudgeted paid calls.

Activity

  1. amiller commented on Oct 14, 2026

    @amiller
    OwnerAuthor

    Research tracker: amiller/awesome-private-inference#23 . First documentation/regression sprint is implemented in draft PR #74. The existing encrypted-text mitigation remains; native protocol enablement and ordinary decoder response refusal are follow-up qualification work. No live paid requests were made.

  2. amiller commented on Oct 14, 2026

    @amiller
    OwnerAuthor

    Runtime sprint implemented in PR #74 at b4d092c. Modern/legacy request history refuses before admission; both native schema formats are stripped; ordinary/coupon reply guards reject unsupported calls. Alternate SSE spacing, CRLF and fragmentation are covered; actual Pi receives an error with no toolCall item. Encrypted-text tools remain available.

    Fresh zed build: 41 focused tests pass; docs pass. Full offline attempt: 46 suites pass and 9 fail (rehearsal socket-path limit, missing legacy MCP entry point, browser startup and UI checks). This is not a passed integration gate. Logs retained, generated outputs/dependencies removed. Integration and independent review remain outstanding.

    Pinned-source DevProof supplement: amiller/devproof-audits-guide#5 . Older Hermes plugin guard: amiller/hermes-tee-providers#3 . Neither is deployed evidence; native all-fields qualification remains future work.

  3. amiller commented on Oct 14, 2026

    @amiller
    OwnerAuthor

    Native protocol qualification is implemented in draft PR #75. On the configured z-ai/glm-5.3-flash model, two consecutive encrypted native echo calls passed; a separate echo/result/final-answer loop passed. All six saved live model signatures reverified. Six POSTs total, catalog-priced signed-usage estimate $0.00022808 within the authorized $0.25 cap. Fifteen new offline regressions plus six existing signature tests pass, including actual Pi native calls and encrypted result history.

    Qualification remains split: field interoperability and authentic model replies passed these bounded checks. Strict gateway/model UpToDate admission failed because gateway firmware is OutOfDate (model is UpToDate). Source-to-deployment closure and private-work integration are not established.

    The reviewed server source also permits trusted service-token callers to supply X-Request-Hash. Therefore a genuine model signature matching the client hash cannot independently prove the actual input body when a privileged gateway asserts that hash. End-user cloud API keys cannot use that override. A synthetic signature-level regression illustrates this dependency; no deployed service-token attack was attempted. Gateway-independent action integrity remains unqualified until client request binding is enforced inside the model enclave, or the gateway/code/privileged credential custody is explicitly trusted and qualified.

    Normal configuration/private-work enablement is unchanged. DevProof PR amiller/devproof-audits-guide#5 and research amiller/awesome-private-inference#23 now record both the live evidence and this integrity dependency. Raw evidence remains private/ignored. Review and applicable integration gates remain open.

  4. amiller commented on Oct 14, 2026

    @amiller
    OwnerAuthor

    Request-origin integrity and inner deployment closure now have a concrete follow-up sprint: #77. This applies to text-carried tools too. PR #75 records the confirmed service-token auth path and limitations of saved compose-manager evidence; successful encrypted native-tool interoperability does not resolve these.

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

    queuedScoped work waiting to be taken up

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions