Secure attachments#95
Open
adambalogh wants to merge 6 commits into
Open
Conversation
Stop flattening user content to text in the enclave. Convert OpenAI-format content parts (text / image_url / file) into LangChain v1 standard content blocks so images and PDFs reach the provider natively instead of being dropped. Text-only content still collapses to a plain string. No new dependencies: the pinned langchain-* versions already translate standard image/file blocks to each provider's native API.
… attachments in request hash - validate_attachments(): reject image/PDF parts when the target model's LangChain profile explicitly lacks support (fails open for unknown models), and enforce a 30 MB inline attachment cap. Wired into create_chat_completion so it covers both the direct and OHTTP-inner paths. - Request hashing now canonicalizes multimodal user content, replacing inline base64 with a sha256 digest so the signed request commits to the exact attachment bytes without bloating the hashed payload.
…#94) * image gen format fixes (#91) * testing image format fix * review fixes * lint fix * Minimize attachment handling: keep provider-native image pass-through Revert the bespoke image-conversion path in convert_messages to main's raw pass-through (text/image parts already convert correctly to every provider's native API, so images keep working untouched). Only file/PDF parts are rewritten to LangChain standard file blocks, since Anthropic needs a 'document' block and rejects OpenAI's raw file shape. Capability gating, the per-request size cap, and request-hash canonicalization are retained. Drop the design doc. --------- Co-authored-by: Aniket Dixit <47004499+dixitaniket@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
…l-hrY9f # Conflicts: # tee_gateway/controllers/chat_controller.py # tee_gateway/llm_backend.py # tee_gateway/test/test_tee_core.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.