PolarisGet Your Polaris
Menu

POLARIS FIELD GUIDE / 3 MIN READ

How a redact-and-restore AI workflow works

A redact-and-restore workflow transforms sensitive source text before external AI processing, then resolves authorized references after the model finishes. Polaris-Mist provides POST /v1/redact and POST /v1/restore for this round trip. Keep the context handle inside the application, send the transformed text to the model, and restore the result within the same authorized task. Validate the finished deliverable against the original business goal.

Define the request boundary

Begin with a backend-owned task identifier and a specific output: for example, a summary of payment exceptions for an internal operator. Identify the source fields required for external reasoning and the fields reserved for the final internal summary. Keep the raw source separate from model request construction.

This separation matters when an application assembles a prompt from several places. Apply the same transformation path to attachments, tool responses and retry messages before assembling the request.

Send source text to redaction

The Mist API accepts a text field, an optional task_id and an optional context_id for continuing a conversation. The limit is 32 KiB of UTF-8 text and 2,048 tokens per request. The response supplies redacted_text, context_id and expires_at.

Store the context handle alongside the task state. Use the returned transformed text as the model input. Keep the original body out of ordinary application traces, error reports and analytics events while recording safe operational identifiers.

Preserve references through model work

Ask the model to keep reference placeholders intact in its response. Test this instruction against the output format you actually need: prose, a table, a structured object or a document template. A model that renames a reference can break restoration even when its prose reads well.

For a multi-step agent, examine tool outputs as well as the first prompt. A retrieval step can introduce a new customer or contract reference. Pass newly introduced sensitive content through the privacy boundary before another external model call.

Restore within the authorized task

Send the model output and the relevant context_id to POST /v1/restore. Mist restores on CPU, with authorization tied to the tenant and task. Its API reference lists responses for invalid credentials, foreign handles, expiration and malformed tokens. Give each state a defined recovery action and deliver the completed document after successful restoration.

For an expired handle, recover through a fresh authorized processing path. For a foreign handle, investigate the task association. Preserve the error category and request identifier without copying the raw payload into a ticket.

Verify the delivered result

Verify the completed work across the full processing sequence. Confirm that each restored organization is attached to the right obligation, that calculations match the source, and that permanent secret markers remain permanent. Compare a known fixture across all three stages before expanding the integration.

Use a release checklist with evidence for normal completion, repeated references, multiple contexts, expiry, malformed placeholders and a failed model request. The resulting artifact is a replayable request sequence plus expected output, allowing the team to repeat the same check after changes.

  • Capture the source-to-placeholder association inside the protected task boundary.
  • Verify the exact outbound payload sent to external AI.
  • Check authorized restoration and final business meaning together.

QUESTIONS & ANSWERS

Details that matter.

Does the external model need the context_id?

Keep the handle in application state. The external model works on the transformed text; the application supplies the handle when it calls restoration.

Can restoration run while the detector is idle?

The Polaris-Mist API performs restoration on CPU without waking the GPU. Detection and restoration are separate stages.

What is the first integration fixture to create?

Use a short document with two distinct entities, a repeated reference, a harmless code and a fake credential. Assert expected content at every stage.

Sources & further reading

Related Polaris work