Human Review
Turn expert decisions on ambiguous cases into reusable controls — the human-in-the-loop layer that makes every future validation sharper.
A policy can't anticipate every edge case. When a validation is genuinely borderline, Prisma doesn't guess and it doesn't silently pass it — it marks the result ambiguous and routes it to a human. The expert's decision is then abstracted into a control and kept in your project's evaluation memory, so the next time a similar case appears Prisma resolves it on its own. Human judgement goes in once; Prisma reuses it forever.
This guide shows how to find the cases waiting for review, submit an expert decision over the REST API, and inspect the controls those decisions create.
How the feedback loop works
Prisma's evaluation memory — HSCM (Highly Superior Catalogued Memory) — is a per-project store that turns every expert decision into reusable guidance. It feeds both validation passes, and a human only ever sees what memory can't already resolve.
Read it in two moves:
- Memory informs validation from the first pass. Before classifying, Prisma retrieves the controls most relevant to the interaction — matched semantically and scoped to your project — and supplies them to the prompt as
{context}. If the first pass is still ambiguous, re-evaluation pulls the closest prior expert rulings as additional{context}and tries again. - Humans only resolve the genuinely novel. A confident classification at either pass ends the validation. Only cases memory can't settle reach the review queue. Each expert decision is abstracted into a new control and written back to HSCM, so the next similar interaction is handled without a human.
This is the flywheel: more expert decisions, richer memory, fewer escalations over time. The reduction is a consequence, not a setting — as controls accumulate, more cases are decided confidently on the first pass and never reach a human.
Before you start
- A project with a policy metric that produces validations — see Policy Metrics and Validations.
- A Prisma API key sent as
X-API-Key: pq_prisma_sk_…(see Installation & Setup), plus your workspace ID (Organization Settings → API Keys). The HITL endpoints takeworkspace_idas a query parameter. - The examples use
httpx, but any HTTP client works.
import os
import httpx
BASE = os.environ["PALQEE_PRISMA_BASE_URL"]
WORKSPACE_ID = os.environ["PALQEE_PRISMA_WORKSPACE_ID"]
PROJECT_ID = "your-project-id"
client = httpx.Client(
base_url=BASE,
headers={"X-API-Key": os.environ["PALQEE_PRISMA_API_KEY"]},
)What lands in the review queue
A metric returns ambiguous when it can't confidently choose one of its options — and ambiguous is the only outcome that escalates. Every interaction your project validates can produce one, whatever path it arrived by (trace, log, or batch). For human-workflow oversight, the headline case is contact-center transcripts:
import palqee_prisma_ai
from palqee_prisma_ai import Evaluators
response_compliance = Evaluators.custom(
name="response-compliance",
evaluation_options=["compliant", "non_compliant"],
score_assignments={"compliant": 1.0, "non_compliant": 0.0},
evaluation_system_prompt=(
"You are a compliance auditor for a financial services contact center. "
"A response is compliant only if the agent verified the customer's identity "
"with two approved factors before taking action. Classify the response as "
"one of: {evaluation_options}."
),
evaluation_human_prompt=(
"Customer:\n{query}\n\nAgent:\n{response}\n\n"
"Policy-correct reference:\n{reference}\n\n"
"Choose one of {evaluation_options} and explain."
),
reeval_system_prompt=(
"You are a senior compliance auditor re-reviewing a borderline case. "
"Apply the two-factor identity policy strictly, guided by prior expert "
"decisions. Classify as one of: {evaluation_options}."
),
reeval_human_prompt=(
"Customer:\n{query}\n\nAgent:\n{response}\n\n"
"Policy-correct reference:\n{reference}\n\n"
"Relevant prior expert decisions:\n{context}\n\n"
"Give your final classification: {evaluation_options}."
),
)
session = palqee_prisma_ai.init(
"compliance-review",
evaluators=[response_compliance],
enable_logging=True,
)
logger = session.get_logger()
for transcript in transcripts:
logger.log(
query=transcript["customer_message"],
response=transcript["agent_reply"],
reference=transcript.get("expected_response"), # optional
)
session.end()Borderline transcripts — an agent who verified identity, but with one factor, or with something that isn't an approved factor (caller ID, name, a partial card number) — are exactly what land in the queue as ambiguous. In the dashboard they show under the project's HITL Requests card and as the Ambiguous column of the Validations table.
Find cases that need review
List the pending requests for your project:
resp = client.get(
"/api/v1/hitl/requests",
params={
"workspace_id": WORKSPACE_ID,
"project_id": PROJECT_ID,
"status": "pending",
"limit": 50,
},
)
requests = resp.json()
print(f"{len(requests)} pending")
for r in requests:
print(f"\n--- {r['id']} ({r['status']}) ---")
print(" Customer:", r["query"][:80])
print(" Agent: ", r["response"][:80])
if r.get("reference"):
print(" Reference:", r["reference"][:80])Each request carries the interaction that needs a human: id, query, response, optional reference, status, and timestamps. Fetch a single one with GET /api/v1/hitl/requests/{request_id} (also workspace_id-scoped).
Submit an expert decision
An expert reads the interaction and records their call. A decision is two fields: evaluation — the classification they chose, one of your metric's options — and explanation, the reasoning that justifies it. The explanation matters: it's what becomes reusable guidance.
resp = client.post(
"/api/v1/hitl/feedbacks",
params={"workspace_id": WORKSPACE_ID},
json={
"request_id": "req_a1b2c3",
"evaluation": "non_compliant",
"explanation": (
"The agent used caller ID plus the last four account digits. Caller ID "
"is not an approved verification factor under SEC-105, so only one valid "
"factor was collected. Two are required before any account action."
),
# Optional free-form metadata (e.g. reviewer, tags) for your own records.
"properties": {"reviewer": "[email protected]", "tags": ["identity-verification"]},
},
)
feedback = resp.json()
print(feedback["id"], feedback["status"]) # e.g. fb_… processingSubmitting feedback resolves the request and kicks off processing. The returned status moves through pending → processing → processed as Prisma turns the decision into a control; failed means processing errored and can be retried. (To change a request's status without submitting a decision, use PATCH /api/v1/hitl/requests/{request_id}/status.)
Review and submit in bulk
One POST per case is fine for a handful of reviews. When a QA team works through a weekly batch, run the whole queue as a file round-trip instead of looping the endpoint — export the cases, review them offline, then submit every decision in one job.
First, export the pending cases into a file your reviewers can work in (csv or json):
export = client.post(
"/api/v1/hitl/feedbacks/export",
params={"workspace_id": WORKSPACE_ID},
json={"project_id": PROJECT_ID, "file_format": "csv"},
).json()
print(export["record_count"], "cases exported")
# Download the generated file for your reviewers.
with open("review_queue.csv", "wb") as f:
f.write(client.get(export["file_url"]).content)Reviewers fill in each row's decision — the evaluation (one of the metric's options) and an explanation. Then hand the completed file back to the File service as a single hitl_feedbacks job; Prisma parses each row and processes it into a control, exactly as a single submission would:
# Upload the completed decisions, then run them as one job.
file = client.post("/api/v1/files/upload", files={"file": open("review_queue.csv", "rb")}).json()
client.patch(f"/api/v1/files/{file['id']}/complete")
job = client.post(
"/api/v1/jobs",
json={
"file_id": file["id"],
"project_id": PROJECT_ID,
"workspace_id": WORKSPACE_ID,
"job_config": {"job_type": "hitl_feedbacks"},
},
).json()
print(client.get(f"/api/v1/jobs/{job['id']}").json()["status"])See the Files & Jobs API for the upload mechanics and the exact job_config schema.
What happens to the decision
Once processed, the decision becomes a control — an abstracted rule plus the expert's reasoning — written into your project's evaluation memory. From then on it's retrieved automatically for similar interactions: as a matching control on the first pass, and as a prior expert ruling during re-evaluation, both injected via {context} (see How the feedback loop works). You don't reference controls in your code — Prisma applies them server-side.
So a new borderline case — say an agent who verified with only a mother's maiden name — now has precedent establishing that single-factor and non-standard verification is non-compliant. The metric classifies it confidently instead of escalating again.
Browse your controls
List the controls a project has accumulated:
resp = client.get(
"/api/v1/controls",
params={"project_id": PROJECT_ID, "limit": 50},
)
data = resp.json()
print(f"{data['total']} controls (showing {len(data['controls'])})")
for c in data["controls"]:
print(f"\n--- {c['display_id']} ({c['status']}) ---")
print(" Rule: ", (c.get("control") or "")[:90])
print(" Metric: ", c.get("metric"))
print(" Evaluator:", c.get("evaluator"))Each control exposes display_id, the abstracted control text, its domain / evaluator / metric, status, and created_at. Narrow the list with search, domain, evaluator, or status query params; page with limit / offset. For aggregate counts use GET /api/v1/controls/stats and GET /api/v1/controls/filters. Inspect, edit, or retire a single control by its node_uuid with GET / PUT / DELETE /api/v1/controls/{node_uuid}. In the dashboard these live under the project's Controls tab.
Operational patterns
- Set a review cadence. A weekly rhythm works for most teams — export the week's ambiguous cases, have domain experts decide, then watch the ambiguous rate on the next runs. The first weeks carry the most reviews; the queue shrinks as controls accumulate.
- Keep controls current. Controls are scoped to a project and metric. When a policy changes, audit existing controls and retire stale ones (
DELETE /api/v1/controls/{node_uuid}) so re-evaluation isn't guided by outdated rulings. - Keep reasoning consistent. Conflicting explanations across reviewers create conflicting memory. Agree on written guidance for common edge cases and route a given category to the same expert where you can.
Troubleshooting
| Symptom | Cause |
|---|---|
401 / 403 | Missing or wrong X-API-Key, or the key isn't scoped to this workspace. API keys are never sent as Authorization: Bearer. |
422 on the requests/feedbacks call | workspace_id query param missing — it's required on every HITL endpoint. |
| No pending requests | Nothing has validated to ambiguous yet. Confirm interactions are reaching Prisma and a policy metric is attached. |
Feedback status stuck at failed | Processing errored — re-submit the decision for that request_id. |
Next steps
- Policy Metrics — author the metrics whose ambiguous cases land here
- Validations — attach evaluators and see how interactions reach Prisma
- HITL API reference — full request/response schemas for every endpoint used above

