Skip to content

feat: adapt gateway policy configuration to shared core - #258

Open
xiaoqi-7 wants to merge 2 commits into
kaito-project:mainfrom
xiaoqi-7:feat/ext-proc-policy-config
Open

xiaoqi-7 wants to merge 2 commits into
kaito-project:mainfrom
xiaoqi-7:feat/ext-proc-policy-config

Conversation

@xiaoqi-7

@xiaoqi-7 xiaoqi-7 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Reason for Change:

Implement phase 2.1: validate gateway policy configuration and map scanner settings to shared core configuration/build APIs. The 77-line policy adapter delegates to core; it does not define a scanner registry, scanner implementations, or a guardrail engine.

Requirements

  • added unit tests and e2e tests (if applicable).

Issue Fixed:

Related to #226.

Notes for Reviewers:

  • Based on upstream main 2ea0177, including refactor: adopt shared core streaming and holdback APIs in ext_proc #257.
  • Pins the published PyPI dependency kaito-guardrail-core==0.2.0, replacing the temporary prerequisite source archive. The 0.2.0 release provides the shared streaming and configuration/build APIs.
  • Accept action, blockMessage, and a non-empty ordered scanners list. Default to block; allow per-scanner action overrides. Reject malformed policy/scanner entries rather than silently skipping protection.
  • Core owns scanner names, normalization, validation, and construction. Tests exercise all eight real shared scanners in block/redact modes and verify validation errors and construction failures.
  • Envoy Process remains UNIMPLEMENTED. Policy file loading, execution, streaming scanner adaptation, deployment, and real Envoy E2E remain out of scope.
  • Validation at 6716ffa: a fresh Python 3.12 environment installed the published core 0.2.0 package; all 82 ext_proc tests, pip check, and git diff --check passed. The dependency contract test now requires the exact published version pin.
  • Local image build encountered an external PyPI TLS handshake failure in the unchanged pip bootstrap step. The updated CI run passed, including published core installation, all ext_proc tests, the ext_proc image build, lint, and amd64/arm64 test and image-build jobs. All PR checks are green.

yiqimicrosoft and others added 2 commits October 29, 2026 13:00
Validate gateway policy settings and delegate scanner configuration and construction to core. Pin the prerequisite source commit until the new configuration APIs are released to PyPI; do not introduce a local registry or change Envoy Process.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: YiqiWang <yiqiwang@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@xiaoqi-7
xiaoqi-7 marked this pull request as ready for review October 29, 2026 23:49

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants