Policy

Embeds the Praxis Policy Engine in-process to enforce multi-source identity, APL route policy, RFC 8693 OAuth 2.0 token exchange, field redaction, session taint, audit emission, and (under body_access: read_write) request / response body rewriting

Category: Setup-dependent integration
Task: Embeds the Praxis Policy Engine in-process to enforce multi-source identity, APL route policy, RFC 8693 OAuth 2.0 token exchange, field redaction, session taint, audit emission, and (under body_access: read_write) request / response body rewriting

Prerequisites: The external service, credentials, or certificates referenced by this configuration.

Run it: Use ghcr.io/praxis-proxy/praxis:0.7.2 and follow the first reverse-proxy tutorial to mount and start the configuration.

This configuration comes from the selected release. The example has not been run here; external services are not bundled.

Download the source file.

Companion resources from the same snapshot:

# Policy Security Filter
#
# Embeds the Praxis Policy Engine in-process to enforce multi-source
# identity, APL route policy, RFC 8693 OAuth 2.0 token exchange, field
# redaction, session taint, audit emission, and (under
# `body_access: read_write`) request / response body rewriting.
#
# The policy filter consumes `mcp.method` / `mcp.name` metadata from
# an upstream protocol classifier filter (available in the `praxis-ai` package), which
# MUST be ordered before it in the chain.
#
# `config_path` points at the policy document (plugins + routes) that
# the filter loads once at construction. It is operator-supplied, not
# shipped here: a real policy carries your own issuers, secrets, routes,
# PDPs, and delegators. See the praxis-demos repo
# (`demos/cpex/policy.yaml`) for a fully-featured policy, and
# `tests/integration/fixtures/policy.yaml` for the minimal
# single-HS256-identity-plugin policy the integration test loads.
#
# `require_protocol_metadata: true` (the default) fail-closes when the
# protocol classifier filter is missing or ordered after `policy` — this guards
# against a misconfigured chain silently bypassing policy.
#
listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains:
      - main

filter_chains:
  - name: main
    filters:
      # A protocol classifier filter (from praxis-ai) must precede `policy` in the
      # chain to stash mcp.method / mcp.name in filter_metadata.
      # See the praxis-ai documentation for setup instructions.

      - filter: policy
        config_path: /etc/praxis/policy.yaml
        # Fail-closed when mcp.method metadata is missing. Set to
        # `false` only when intentionally fronting non-classified traffic
        # through the policy filter for identity-only enforcement.
        require_protocol_metadata: true

      - filter: router
        routes:
          - path_prefix: "/"
            cluster: backend

      - filter: load_balancer
        clusters:
          - name: backend
            endpoints:
              - "127.0.0.1:3000"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends