Skip to content

[Enhancement]: implement WP2 shared transport trust policy #5

Description

@Qiao-yq

Description

Context

Part of #3. WP2 ports the shared transport security policy from the accepted PowerContext target to PowerContext Go without changing the OpenAPI contract or copying the Python package layout.

Completed scope

  • Add one shared Go transport-trust policy covering localhost, IPv6 ::1, and the complete IPv4 127.0.0.0/8 range.
  • Reject plaintext non-loopback Client requests by default, including unauthenticated requests carrying Source or Memory content.
  • Permit a non-loopback HTTP label only when the caller supplies its own transport and explicitly vouches that the transport is secure.
  • Reject unauthenticated non-loopback Server binds by default.
  • Add an explicit operator opt-in for controlled-network or TLS-terminated deployments.
  • Apply the policy after CLI host and port overrides have been merged.
  • Align every adapter currently present in this repository: Bub, Claude Code, Codex, DSH, Hermes, LangGraph, OpenClaw, OpenCode, and Pi.
  • Add drift guards for Client, Server, CLI, Docker/runtime configuration, documentation, and adapter-native test suites.

Acceptance evidence

  • All shared loopback vectors are accepted, including addresses across 127.0.0.0/8.
  • Plaintext non-loopback Client requests fail closed at construction and at the final RoundTripper, including per-request ogen URL overrides.
  • Unauthenticated non-loopback Server binds fail closed by default.
  • The Client secure-transport vouch and Server/operator opt-in work and are documented.
  • Safe CLI overrides can repair an unsafe environment host; unsafe overrides cannot weaken a safe environment without authentication or opt-in.
  • Current retained adapters use the same fixture and policy semantics.
  • Unit, integration, adapter, generated-output, race, fuzz, cross-platform, Docker, documentation, license, downstream, and Acceptance checks passed on the submitted Heads.
  • No OpenAPI or unrelated generated contract changed.

Delivery

Deferred adoption outside this issue

WorkBuddy and LangChain are not currently implemented in this repository. Their P1/P2 implementation remains tracked under WP3/WP4 in #3. When added, they must consume test/transport/testdata/loopback_hosts.json and satisfy the same plaintext, loopback, and explicit-trust contract. This issue does not mark those integrations as implemented.

Non-goals preserved

  • Changing openapi/powercontext.yaml.
  • Adding a new authentication mechanism.
  • Enabling arbitrary public-network access by default.
  • Addressing WP3-WP6 feature implementation beyond recording the future adapter adoption requirement.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions