fix(codeapi): bind issuer trust and sanitize public boundaries - #18
Closed
rschlaefli wants to merge 10 commits into
Closed
fix(codeapi): bind issuer trust and sanitize public boundaries#18rschlaefli wants to merge 10 commits into
rschlaefli wants to merge 10 commits into
Conversation
This was referenced Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This Fixes
This PR prepares CodeAPI's existing execution service for another trusted
chat client without adding the Klicker integration itself:
algorithms, key IDs, and accepted principal sources.
file routes while keeping the sandbox v2 transport explicitly internal.
retaining bounded status, reason, duration, count, and byte evidence.
This is a draft for focused trust-boundary, public-contract, and logging review.
How It Works
CODEAPI_JWT_TRUST_ENTRIES_JSONdefines strict issuer-bound trust entries.Legacy issuer, audience, algorithm, and key inputs still normalize to one
LibreChat-compatible entry when the new variable is absent.
issonly to select a policy. Signature, key,algorithm, audience, source, and time checks run under that selected policy.
fields across the service and sandbox runtime paths.
reject raw, encoded, hashed, nested, message, and stack representations of
synthetic client values.
Important Details
docs/adr/0001-issuer-bound-jwt-trust.md;the execution record is in
docs/project/2026-08-30-pr-18-codeapi-trust-contract-logging-plan.md.duplicate, missing, orphaned, or algorithm-incompatible key assignments fail
configuration.
rate-limit behavior is added or changed.
verification covers all source changes; deployment and live proof remain
separate.
Branch Coverage
main@83c4f7ba93874e83c4f7b..0be1654; the three later commits update only thecommitted plan, verification status, and PR metadata.
API contract, service-edge logging, runtime logging, tests, ADR, and final
verification evidence.
project plan; no lockfile or generated-output delta is present.
Review Focus
that legacy LibreChat behavior remains equivalent.
service/openapi.ymlwith the runtime v1 execution and file routes,especially generic errors, timeouts, rate limits, and download behavior.
where arbitrary errors or client values could re-enter logs.
/api/v2/executetransport remains separate from thepublic v1 contract.
Verification
Current head:
git diff --check-> pass ata93874e.leaks found.
Earlier branch verification:
bun test-> pass at source SHA0be1654.0be1654.bun run test-> 569/569 pass at source SHA0be1654.0be1654.tests/block_root_package_delivery.sh-> pass at source SHA0be1654.tests/sandbox_runner_healthcheck.sh-> pass at source SHA0be1654.maintainability, security, and architecture -> no findings.
The verification remains applicable because
0be1654..a93874echanges onlythe committed project plan.
Failed/Warning:
bun testinservice/also discovers the k6 stressscript and fails to resolve
k6/http. The repository-defined and CI-alignedcommand is
bun run test, which passed 569/569.warnings plus two existing TS2352 warnings.
Not run:
proof was used. Those actions and values are outside this PR's authority and
scope.
Security / Privacy
followed by the integrated final review.
production values, personal data, or execution payloads are included.
Blocking Before Merge
Follow-Up After Merge
a separate deployment change.
staging under separately approved rollout and live-smoke plans.
Local Session Artifacts
Machine-local pointers for a session resuming this branch, not review evidence.
MacBook-Pro.localtrees/codeapi-trust-contract-loggingin repositorycode-interpreterdocs/project/_local/reviews/