Skip to content

feat(examples): add supervisor middleware content guard#2169

Open
pimlock wants to merge 8 commits into
mainfrom
1733-supervisor-middleware-example/pimlock
Open

feat(examples): add supervisor middleware content guard#2169
pimlock wants to merge 8 commits into
mainfrom
1733-supervisor-middleware-example/pimlock

Conversation

@pimlock

@pimlock pimlock commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a runnable supervisor middleware content-guard example for the middleware shipped in #2027. The example demonstrates operator-run service registration, policy attachment, request-body inspection, and allow, deny, and redact responses.

Related Issue

Related to #1733

Changes

  • Add a standalone Rust content-guard gRPC service using the supervisor middleware API
  • Support configurable term matching with redact and deny modes, audit-safe findings, and a stable deny reason code
  • Add an example policy using the keyed network_middlewares format and operator-owned registration name
  • Add smoke.sh to build and launch the gateway, middleware, and sandbox with automatic cleanup
  • Demonstrate the same payload going through a guarded httpbin.org request and an unguarded httpbingo.org request
  • Document the smoke flow, openshell.supervisor.middleware registration, body limit, and timeout behavior
  • Keep the example lockfile reproducible and aligned with the current workspace dependencies

Testing

  • mise run pre-commit passes
  • examples/supervisor-middleware-content-guard/smoke.sh --test-suite passes
  • cargo test --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml passes
  • Unit tests cover redaction, denial and reason code, pass-through, and invalid configuration
  • Smoke coverage verifies a selected request is filtered and an allowed unselected request is unchanged

Checklist

@copy-pr-bot

copy-pr-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@pimlock

pimlock commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 06c0433

@pimlock

pimlock commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test e8e6456

Base automatically changed from 1733-supervisor-middleware/pmlocek to main July 17, 2026 00:47
@pimlock pimlock self-assigned this Jul 17, 2026
pimlock added 6 commits July 17, 2026 11:23
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
@pimlock
pimlock force-pushed the 1733-supervisor-middleware-example/pimlock branch from 482309c to 6f57bfd Compare July 17, 2026 18:39
@pimlock
pimlock marked this pull request as ready for review July 17, 2026 18:40
pimlock added 2 commits July 17, 2026 12:22
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
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.

1 participant