Skip to content

Commit b0fa641

Browse files
docs: clarify AI inference validation scope (praxis-proxy#624)
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent edf7e37 commit b0fa641

3 files changed

Lines changed: 29 additions & 12 deletions

File tree

.claude/CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ See `docs/filters/extensions.md` for the full guide.
208208
`tests/integration/tests/suite/examples/`
209209
7. Run `cargo xtask sync-example-readme --fix`
210210

211+
For AI inference filters, follow
212+
`docs/developing/adding-filters.md#ai-inference-validation`:
213+
validate only fields needed for local proxy behavior and
214+
leave backend-owned API semantics to the inference backend.
215+
211216
## Adding a Protocol
212217

213218
1. Implement `Protocol` trait under `protocol/src/`

docs/developing/adding-filters.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,15 @@ first.
2121
All testing requirements from [conventions.md](conventions.md#testing)
2222
apply. A feature without tests and an example is not
2323
complete.
24+
25+
## AI Inference Validation
26+
27+
AI inference filters should validate only fields they
28+
need for local proxy behavior, such as routing,
29+
transformation, persistence, metering, or security
30+
policy decisions. Do not validate backend-owned API
31+
semantics such as required inference fields, parameter
32+
types or ranges, nested message/tool structures, or
33+
unknown extension fields unless the filter must act on
34+
that value itself. Preserve the original request and
35+
let the inference backend perform protocol validation.

docs/proposals/00484_anthropic-messages-api-filters.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ The scope covers five capabilities:
6060

6161
[mid-conversation system messages docs]: https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages
6262

63-
2. **Request validation**: validate only the fields
64-
that affect gateway/filter behavior: `messages`
65-
is non-empty, `max_tokens` is present and > 0,
66-
and `model` is non-empty. All other fields are
67-
forwarded to the inference backend unmodified —
68-
the backend handles parameter ranges, model
69-
availability, role ordering, and content-level
70-
validation. Unlike the Responses API, `Anthropic`
71-
Messages does not require persistence or stateful
72-
orchestration, so the validation filter is
73-
lighter: no shared state struct, no store
74-
initialization.
63+
2. **Request validation**: validate only request
64+
properties the gateway or filters must act on
65+
locally. All other fields are forwarded to the
66+
inference backend unmodified; the backend handles
67+
Anthropic API requirements such as required fields,
68+
parameter types and ranges, model availability, role
69+
ordering, and content-level validation. Unknown
70+
fields are expected and must be preserved. Unlike
71+
the Responses API, `Anthropic` Messages does not
72+
require persistence or stateful orchestration, so
73+
the validation filter is lighter: no shared state
74+
struct, no store initialization.
7575

7676
3. **Format transformation**: bidirectional conversion
7777
between `Anthropic` Messages and `OpenAI` Chat

0 commit comments

Comments
 (0)