a2a
Extracts A2A protocol metadata from JSON-RPC request bodies and promotes method, family, task ID, streaming detection, and version to request headers, filter results, and durable metadata for routing.
Guardrails and usage
Discover operator capabilities, required filters, and pipeline ordering.
This page explains how filters compose; the generated filter reference has the exact settings. Capabilities not marked optional are registered in the default production binary. Check build features before choosing an image.
| Operator task | Filters and prerequisites | Order and working material |
|---|---|---|
| Identify the client operation | ai_operation; protocol body owners openai_chat_completions_request, anthropic_messages_request, or experimental openai_responses_request | Classify before operation-dependent policy. Client paths, reference |
| Forward a native API | Core router, headers, load_balancer; provider endpoint, Host, TLS/SNI, credentials | Select a cluster before credential injection. Quickstart, Anthropic recipe |
| Translate protocols | Direction-specific request/response adapter plus SSE adapter where required | Request owner before translation; select the provider before selected-provider translation. Compatibility matrix, path table |
| Map public model aliases | model_to_provider, then load_balancer | Do not add a competing router. Routing recipe, reference |
| Select providers dynamically | model_to_header, intelligent_route, credential_inject, load_balancer; trusted candidate catalog and secrets | Selection publishes the profile used by adapters and credentials. Routing recipe, reference |
| Route within a provider | peer_identity_trust, provider_route, endpoint selection | Requires authenticated downstream mTLS and trusted routing assertions. Example, reference |
| Change prompt content | prompt_enrich; protocol-compatible Chat body | Apply before final token ceilings and inference. Example, reference |
| Separate identities and secrets | Authentication boundary, state_owner, identity_header_guard, project_state_owner_headers, callout_credentials as appropriate | Header capture does not authenticate provenance. Authenticate or delete-then-set assertions at a trusted ingress. Credential boundaries, state owner |
| Screen content | ai_operation, then ai_guardrails; NeMo 0.24.0+ and deployed rails | Configure outbound callout policy. Response screening has streaming restrictions. Recipe, reference |
| Extract and observe usage | model_to_header, token_count, optional token_usage_metrics, time_to_first_token | Body counts are available after headers; do not promise token_usage_headers on these paths. Recipe, count reference |
| Bound output or reserve token budgets | Optional experimental token_ceiling, token_rate_limit, inflight_tracker | Ceiling evaluates the final provider-bound body; rate limiting needs its configured budget backend and trusted key dimensions. Ceiling example, rate-limit reference, inflight reference |
| Check balance and report usage | external_metering; reachable metering service, destination-bound callout authentication | Pre-request admission and post-response reporting are separate. File-key example, reference |
| Broker MCP or route A2A | mcp, a2a, core JSON-RPC and routing; reachable services | Protocol discovery/routing does not execute model tools. MCP example, A2A example, architecture |
| Manage Responses, tools, files, history | Experimental Responses filters, selected tool groups and store backend | Follow the whole pipeline, including IRR, streaming composition, owner scope, and callout limits. Recipe, store architecture |
Request hooks generally run in declared order and response hooks in reverse. Body and header phases are separate: moving a usage reader later cannot make body-derived data available before response headers are sent. Branches and IRR steps have their own lifecycle, so check a body filter’s declared phase and pipeline validation before moving it into a branch.
Start from the complete examples linked above and run
praxis-ai --validate -c FILE with the binary you will deploy. Validation
proves registration and static constraints, not backend compatibility,
credentials, or tool execution. Streaming transformations need their SSE
adapters and bounds; a finite JSON translation does not imply streaming
support.
Core routing, load balancing, TLS, authentication, headers, rate limiting,
CORS, compression, and other base proxy behavior are in the
Praxis core reference. Provider credentials have two owners
with different configuration formats: core credential_injection uses a
selected cluster, and AI credential_inject uses the selected dynamic
provider profile.
Generated filter pages live in category folders under docs/filters/
(apis, providers, routing, control, agents, observability, and
core), grouped the same way in the reference index.
cargo xtask generate-filter-docs assigns each filter a category; the
category table and overrides are in xtask/src/filter_docs.rs.
Rust crate layout is in the embedding guide. Custom Rust hosts follow its registration instructions, including the response-store pipeline extension when needed.
Extracts A2A protocol metadata from JSON-RPC request bodies and promotes method, family, task ID, streaming detection, and version to request headers, filter results, and durable metadata for routing.
Calls an external AI guardrail provider to evaluate request and response bodies. The provider determines whether content should be passed, blocked, or redacted.
Classifies supported AI operations from the request head.
Executes the Anthropic Messages MCP connector for non-Anthropic backends.
Normalizes Anthropic Messages protocol headers for native backends.
Read the release-matched anthropic messages request documentation and its scope.
Transforms Anthropic Messages API requests to Chat Completions-compatible request bodies and transforms compatible responses back.
Transforms streaming SSE responses between the Chat Completions and Anthropic Messages formats, processing each chunk as it arrives.
Read the release-matched anthropic messages to vertexai anthropic documentation and its scope.
Executes server-owned WebSearch tool calls in an Anthropic Messages loop.
Signs outbound requests to AWS services using SigV4.
Injects an Azure AD (Entra ID) bearer token into outbound requests.
Establishing filter that captures typed per-user callout secrets from ingress headers.
Replaces caller credentials with the upstream credential selected by intelligent_route or provider_route.
Extend Praxis AI with custom filters using the Praxis core filter interfaces and registration model.
Integrates with an external metering service for pre-request balance checks and post-response token usage reporting.
AI filters provided by Praxis AI, grouped by the task they serve. For base proxy filters (router, load balancer, headers, CORS, etc.), see the Praxis core filter reference.
Injects a GCP OAuth2 access token into outbound requests.
Calls an external HTTP service during request processing and feeds its response into branch-chain evaluation.
Captures request headers matching a configured prefix into filter_metadata and removes them from the upstream request.
Read the release-matched inflight tracker documentation and its scope.
Select an upstream cluster for an inference model or MCP tool from a validated routing snapshot. Place this filter after request classification and before load_balancer.
Rewrites publisher-ID body model values to the short model name for LLMISvc / KServe routing; the routing header is left unchanged.
Extracts MCP JSON-RPC method, tool, resource, prompt, version, and session metadata into filter-visible request fields.
Selects the broker-staged backend cluster for an MCP handshake subrequest.
Promotes the JSON “model” field from the request body to a request header.
Read the release-matched model to provider documentation and its scope.
Agentic loop controller for the Responses API pipeline.
Read the release-matched openai chat completions request documentation and its scope.
Read the release-matched openai chat completions streaming selector documentation and its scope.
Read the release-matched openai chat completions to anthropic documentation and its scope.
Read the release-matched openai chat completions to anthropic stream documentation and its scope.
Transforms requests targeting Azure OpenAI deployments into standard Chat Completions-compatible form and normalizes responses back.
Transforms OpenAI Chat Completions requests into Vertex AI Gemini generateContent format and translates responses back.
Lowers rich client-owned tool declarations to private function tools for a function-only Responses backend and restores the typed items on the way back.
Serve OpenAI Conversations API endpoints locally through the configured response store.
Converts input_file content parts to input_text for backends that do not support input_file natively (e.g. vLLM, llm-d).
Resolves file_id and file_url references in Responses API input by fetching content from a Files API or remote URL via ApiClient and inlining the base64-encoded content in the provider-native field.
Read the release-matched openai file search dispatch documentation and its scope.
Discovers and executes MCP tools for the Responses API agentic loop.
Summarizes conversation history when the token count exceeds a configured threshold.
Rewrites the model field in Responses and Chat Completions request bodies.
Rebuilds the request body from ResponsesState when present.
Validates previous_response_id by fetching the stored response, confirming its status is “completed”, and populating ResponsesState with the full conversation history (stored turns + current input).
Processes a Responses request body once and initializes state.
Read the release-matched openai responses store documentation and its scope.
Read the release-matched openai responses to chat completions documentation and its scope.
Composes the current IRR execution into one logical Responses stream.
Parses tool definitions and tool_choice from Responses API request bodies and promotes routing facts to metadata and filter results without mutating the body.
Read the release-matched openai web search dispatch documentation and its scope.
The experimental token-quota-filter feature registers the ai/token-quota host plugin with the Praxis Policy Engine (PPE).
Projects a normalized [StateOwner] into destination-specific HTTP headers.
Injects statically configured messages into the messages array of OpenAI-compatible chat completion request bodies.
Exact provider-local mapping from an authenticated intelligent routing selection to a private backend cluster.
Establishes a normalized [StateOwner] from trusted identity sources.
Injects stream_options.include_usage = true into streaming OpenAI chat-completions requests so the upstream response contains token usage.
Measures time-to-first-token for streaming AI responses.
Rejects provider-bound requests whose estimated serialized request body or requested output exceeds configured limits.
Extracts token usage from AI inference responses and writes unified counts to [filter_metadata].
Token-denominated rate limiter: reserves an estimated cost at admission, reconciles against actual usage after the response completes.
Injects Praxis-Token-Input, Praxis-Token-Output, and Praxis-Token-Total headers into downstream responses when token usage data is present in [filter_metadata].
Read the release-matched token usage metrics documentation and its scope.