Repository navigation
Description
summary
an anthropic /v1/messages request with tools[].strict: true loses that flag
when switchyard translates it to an openai chat backend. name, description, and
parameters survive, strict does not. the client still gets http 200 with no
error.
repro
build switchyard main, tested at 27fc1ce9ff3846760337fe42ab09c28f5b01c807,
and configure an openai_chat target backed by a local capture server. send
this complete Anthropic Messages request five times:
curl -sS http://127.0.0.1:9004/v1/messages \
-H 'content-type: application/json' \
-H 'anthropic-version: 2023-06-01' \
-d '{
"model": "captured-model",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Use the tool."}],
"tools": [{
"name": "strict_probe",
"description": "Verify strictness survives translation.",
"strict": true,
"input_schema": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
"additionalProperties": false
}
}]
}'expected forwarded tool:
{"type":"function","function":{"name":"strict_probe","strict":true}}actual forwarded tool:
{"type":"function","function":{"name":"strict_probe"}}confirmed 5/5 against a keyless local capture backend. every client call
returned http 200 while strict was absent. the same tool sent as a native
openai chat request with function.strict: true keeps the field through the
same server and backend, so this is an ingress-side loss, not something openai
chat is unable to express.
the full keyless reproducer, five failure captures, and five control captures
are in the linked Kairo finding:
Atharva-Kanherkar/kairo#22
root cause
decode_anthropic_toolsincrates/switchyard-translation/src/codecs/anthropic/buffered.rs
builds every tool withstrict: Noneand never reads thestrictfield from
the incoming request.encode_openai_toolsincodecs/openai_chat/buffered.rsalready writes
function.strictwhen the value is present, so the loss is entirely on the
decode side.encode_responses_toolsincodecs/responses/buffered.rsforwardsstrict
the same way, and reads from the same tool listdecode_anthropic_tools
builds. an anthropic request routed to an openai responses backend is likely
affected too, but was not verified in this report.
not a duplicate
issues #467, #452, and #462 are about response_format / output_config.format,
whole-response json-schema enforcement. this is tools[].strict, a separate
field on ToolDefinition for per-call argument enforcement. searched issues,
prs, discussions, and code for strict and decode_anthropic_tools, and found
nothing else covering this.
impact
this is a silent loss: no diagnostic and http 200 on every run. an app relying
on strict to skip its own argument validation can receive schema-violating tool
arguments with no signal that enforcement was dropped.
Activity