Make Mistral Batch Metadata a Server-Owned Policy Field
Mistral batch creation accepts optional custom metadata beside the model, endpoint and request file. The application should build that metadata from authenticated workflow state, restrict its fields and values, and reconcile it with the job record instead of trusting caller labels.

Mistral batch job creation accepts optional custom metadata beside the input files, model and endpoint. The Mistral batch-processing guide shows a metadata object on the create operation and describes it as custom metadata for the batch. That small object can become an ownership label, retention selector or reporting field inside enterprise workflows.
A client-written label is weak evidence. I would keep metadata construction on the server and treat every unknown field as a contract failure.
TL;DR
- Build Mistral batch metadata from authenticated workflow state instead of forwarding arbitrary caller name-value pairs.
- Allowlist each field, type, value format and length, while excluding prompts, personal data, secrets and authorization decisions.
- Bind the approved metadata digest to the input file, model, endpoint, owner and policy version before job creation.
- Compare returned job metadata with the enterprise record and authorize result delivery against current identity and workflow state.
Metadata carries operational labels
The Mistral Batch API reference separates job creation from later get, cancel and delete operations. Metadata travels with the provider-side job record, but the enterprise still owns authorization and workflow state.
A field such as department=finance can help operators filter or reconcile jobs. Caller identity still comes from the authenticated enterprise record. A retention=30d label can express the selected policy, while deletion controls and the source approval remain authoritative.
Create the authoritative job record before the provider call. Bind the authenticated principal, tenant, route, source file digest, exact model, endpoint, policy version and approved metadata. The provider response adds the Mistral job ID and timestamps to that record.
An allowlist defines the metadata contract
Keep the accepted object small. For each field, define the type, maximum byte length, permitted character set, source field and allowed values. Reject nested objects unless the workflow has a specific schema and a tested reason for them.
Useful labels are opaque and operational. A workflow identifier, internal cost-center code, data-classification code or job-purpose enum can support reconciliation without copying prompt content. Customer emails, case notes, access tokens, API credentials and raw document names belong outside provider metadata.
The Mistral batch endpoint validation guide covers the target operation and row contracts. Metadata should agree with that decision. A job labeled for embeddings should fail when its approved endpoint is chat completion.
On the release screen, show approved metadata as six compact name-value rows beside the file digest. Put rejected fields below in red without their sensitive values. The operator should see which policy field failed before the upload or create call occurs.
Server construction removes caller ambiguity
Accept high-level workflow choices only when the authenticated role is permitted to make them. Map each choice to a server-owned metadata value. Ignore no extra fields silently, because hidden discards make clients believe their labels control behavior.
Canonicalize the approved object before hashing it. Sort fields, serialize values with fixed type rules and record the canonicalization version. Bind the digest to the same decision record as the input file, model and endpoint. This catches a metadata change between validation and job creation.
The batch custom ID correlation guide handles individual request ownership. Batch metadata describes the job as a whole. It should never replace row-level identifiers or the enterprise ledger that accounts for every result.
Keep policy resolution asymmetric. The caller proposes a workflow action. The server resolves metadata, endpoint, model and retention from authenticated state. That design prevents a copied request from relabeling another tenant's job.
Retrieval verifies the enterprise record
When the application retrieves a batch job, compare its provider ID, metadata, model, endpoint and input references with the enterprise record. An unknown provider job or changed metadata belongs in a hold state until an operator resolves it.
Use the enterprise record for authorization. A matching tenant label in provider metadata cannot grant access to results, cancellation or deletion. Re-evaluate the current principal and job state for each operation. Preserve the original submission decision and the later delivery, cancellation or deletion decision as separate events.
The Mistral audit-log boundary guide explains why provider account events and per-request enterprise evidence answer different questions. Batch metadata helps join records. It remains one field inside a larger decision history.
Retention also stays outside the label. Schedule deletion through the enterprise workflow, verify the provider operation and record the result. A metadata value that says retention=30d without a verified deletion event is a note, not control evidence.
Tests target trust and data leakage
Build a valid job request from the production manifest, then change one property per test.
- Add an unknown metadata field.
- Change an approved enum to a free-text value.
- Put an email address, prompt fragment or token into a label.
- Exceed the byte limit with valid characters.
- Change metadata after validation but before job creation.
- Label a chat endpoint as an embeddings workflow.
- Retrieve a job whose metadata digest differs from the enterprise record.
- Request another tenant's results using a copied tenant label.
- Set a retention label and omit the scheduled deletion action.
Assert zero provider calls when request metadata fails. Assert zero result delivery, cancellation or deletion when current authorization fails. Record identity, route, metadata digest, source file digest, model, endpoint, policy version, provider job ID and operation outcome.
DeepInspect
DeepInspect can enforce metadata field and value policy on authenticated Mistral batch HTTP requests deliberately routed through its proxy. It can bind the decision to identity, route, model, endpoint, file digest and policy version before provider egress.
Application teams own workflow state, metadata semantics, job reconciliation and retention execution. Mistral stores and returns provider-side job data. Local files, direct provider calls and lifecycle actions outside the proxy remain outside DeepInspect's enforcement boundary.
Book a technical deep dive at deepinspect.ai.
Frequently asked questions
- Can metadata include a customer name?
Prefer an opaque customer or workflow identifier. Names create another provider-side copy of personal data and can appear in dashboards, support exports or logs. Keep the join to the customer record inside the enterprise system.
- Should unknown fields be ignored?
Reject unknown keys because they can signal client drift, a spelling error or an attempt to influence policy. Return the key name and expected schema without reflecting sensitive values into broad logs.
- Can metadata select retention policy?
An authorized workflow choice can map to a server-owned retention code. The actual retention decision, deletion schedule and verified deletion event belong in the enterprise record.
- What belongs in the audit record?
Capture the authenticated identity supplied by the application, tenant, route, canonical metadata digest, approved field set, input file digest, model, endpoint, policy version, provider job ID and each later delivery or lifecycle decision.