AI Security
Protecting Customer Documents in an Azure OpenAI Summarization Workflow
TL;DR: Store raw documents in an encrypted Azure Blob container, grant the Azure OpenAI model only read‑only access via a short‑lived SAS token, encrypt the request payload with TLS, log every summarization call with document IDs and user who triggered it, and delete the temporary copy after the summary is stored in a separate, access‑controlled container.
What is the threat model for a document‑summarization pipeline?
When a user uploads a PDF, contract, or any confidential file, the data travels through three stages:
- Upload to Azure Blob Storage (at rest).
- Retrieval by an Azure OpenAI model for processing (in transit).
- Storage of the generated summary (at rest).
Adversaries may try to:
- Intercept the file during upload or API call.
- Exploit overly permissive storage keys to read or modify documents.
- Harvest summaries that contain sensitive excerpts.
Mitigating these risks starts with a clear data‑flow diagram and applying the OWASP GenAI guidelines for confidentiality and integrity.
How to encrypt documents at rest and in transit
At rest: Enable Azure Storage Service Encryption (SSE) for the blob container that receives raw uploads. SSE encrypts each blob with a Microsoft‑managed key by default; you can optionally bring your own key (BYOK) for stronger control.
In transit: All Azure services expose HTTPS endpoints. Ensure the client SDK forces TLS 1.2+ and verify the certificate chain. When invoking the Azure OpenAI endpoint, the request body is sent over TLS, protecting the payload from network eavesdropping.
How to enforce least‑privilege access for Azure OpenAI
Instead of giving the OpenAI resource a permanent storage account key, use a short‑lived Shared Access Signature (SAS) with the following constraints:
- Read‑only permission on the source container.
- Expiration no longer than the expected processing time (e.g., 5 minutes).
- IP‑range restriction to the Azure OpenAI service’s outbound IPs (available in the portal).
Generate the SAS token in your backend just before calling the model, inject it into the request payload, and discard it immediately after the call returns.
How to audit and log summarization requests
Maintain an immutable audit log in a separate Azure Log Analytics workspace or a simple append‑only table in Azure Table Storage. Log the following fields for every request:
{
"timestamp": "2026-08-10T14:23:00Z",
"user_id": "[email protected]",
"document_id": "blob://raw-docs/contract-12345.pdf",
"summary_id": "blob://summaries/contract-12345-summary.txt",
"sas_token_id": "sas-20260810-1423",
"model": "gpt-4o",
"status": "success"
}
Include the SAS token identifier (not the token itself) to enable post‑mortem analysis without exposing secrets. Configure a retention policy that aligns with your compliance requirements (e.g., 90 days).
How to securely delete temporary files
After the summary is generated, delete the original blob using the Delete operation with the DeleteSnapshots flag to remove any snapshot copies. If you enabled soft delete, purge the blob immediately to prevent recovery:
az storage blob delete \
--container-name raw-docs \
--name contract-12345.pdf \
--account-name mystorage \
--delete-snapshots include
az storage blob purge-deleted \
--container-name raw-docs \
--name contract-12345.pdf \
--account-name mystorage
Automate this step in your backend function so that no human can forget to clean up.
How to integrate the workflow with a no‑code automation platform (optional)
If you prefer a visual builder like n8n or Make, expose the backend endpoint that creates the SAS token and logs the request. Both platforms support HTTPS calls and can store the summary back into a second blob container. Just make sure the platform’s API key is stored in a secret manager and never hard‑coded.
For teams that need extra assurance, AISecAll can run a quick security review of your Azure OpenAI integration and help you harden the pipeline before it goes live.
Need a practical AI security review?
AISecAll reviews prompts, tool permissions, document flows, and agent behavior so small teams can use AI without guessing where the risk sits.