Solid framework, and the execution-receipt approach is the right level of abstraction for layers 3 and 4 in your taxonomy. The framework-agnostic profile + LangChain reference implementation is clean.
One observation from running similar architectures in EU production: the tool-call boundary catches integrity failures, but it’s downstream of where most modern attacks actually originate. The 5-layer model holds up better if layer 1 (runtime safety) and layer 2 (data protection) have their own intercept point upstream of the tool call.
Concretely, a prompt injection hidden in a retrieved document, or a PII leak in an LLM output, never trips a tool-call interceptor. Both happen in the LLM round-trip itself, before any tool is invoked. By the time the wrap_tool_call hook fires, the agent has already been compromised (in the injection case) or already leaked data (in the PII case).
What I’ve found works as a complement to your design: a transparent reverse proxy on the LLM provider boundary (network path, not LangChain runtime) that scores every input and output against a shield suite, and surfaces verdicts as structured metadata. The receipt model you describe then attaches the runtime safety verdict (along with policy hash, etc.) to the execution receipt, giving you layers 1 to 4 in a single audit trail.
Example shape on the proxy side:
from langchain_senthex import ChatSenthex
chat = ChatSenthex(provider="openai", model="gpt-4o-mini")
response = chat.invoke("...")
print(response.response_metadata["senthex"])
# {
# 'shield_status': 'pass',
# 'injection_score': 0.0,
# 'pii_found': 0,
# 'data_classification': 'PUBLIC',
# 'request_id': 'b5c654b4-...',
# ...
# }
That covers the input and output side. Your wrap_tool_call layer would still handle the action side. Together they cover the 5 layers without overlap.
Disclosure: I built langchain-senthex (EU-hosted reverse proxy, GitHub - YohannSidot/langchain-senthex: LangChain provider for Senthex Proxy — EU-hosted AI firewall with 26 shields, EU AI Act Article 15 audit · GitHub). Curious if your framework-neutral profile spec has room for upstream verdict ingestion. That’s exactly the kind of interop point that would make multi-layer auditing actually work in practice rather than living in silos.