Inferensys

Prompt

Risk Score vs. Refusal Decision Mapping Prompt

A practical prompt playbook for product teams defining the relationship between numeric risk scores and binary refusal actions. Produces a mapping table with justification for each threshold boundary, handling edge cases where scores fall near decision boundaries.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Define the exact job this prompt performs, the context it requires, and the boundaries where it should not be applied.

This prompt is designed for product and safety engineering teams who need to translate a continuous numeric risk score into a discrete, defensible refusal action. The core job-to-be-done is not just classification, but policy mapping: taking a calibrated score from an upstream safety classifier and producing a structured decision table that defines exactly which score ranges map to 'allow', 'warn', 'redirect', 'escalate for human review', or 'block'. The ideal user is an ML engineer, safety platform builder, or trust-and-safety product manager who already has a risk scoring model and needs to operationalize it into a production gating function. Required context includes the upstream classifier's score range and semantics, the organization's safety policy categories, and the available response actions the system can take.

Use this prompt when you are defining threshold boundaries for the first time, recalibrating thresholds after a model update, or documenting the rationale for audit and compliance review. It is particularly valuable when multiple stakeholders—safety, legal, product—need to agree on where the lines are drawn. The prompt forces explicit justification for each boundary, which makes the decision-making process reviewable. It also handles edge cases near decision boundaries through sensitivity analysis, helping teams anticipate where small score fluctuations could flip a decision and where guard bands or tie-breaking rules are needed. Do not use this prompt if you do not yet have a calibrated risk score to map. It assumes the score exists and is meaningful; it does not build the classifier itself. For building the classifier, refer to the Safety Classification Confidence Scoring Prompt Template in this content group.

This prompt is not a replacement for A/B testing or production monitoring. The mapping table it produces is a design artifact—a hypothesis about where thresholds should be. Before shipping, you must validate the proposed thresholds against a labeled golden dataset, measure refusal rates and false-positive/false-negative trade-offs, and run the Confidence Threshold A/B Test Configuration Prompt to compare alternatives in production. Also avoid using this prompt for real-time per-request gating; it is a design-time tool for producing a configuration that your application code then enforces. For runtime gating, use the Risk Threshold Gating Decision Prompt, which consumes the threshold configuration this prompt produces and applies it to individual requests with audit trail generation.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Risk Score vs. Refusal Decision Mapping prompt delivers value and where it introduces operational risk.

01

Good Fit: Threshold Calibration

Use when: product teams need a documented, repeatable mapping between numeric risk scores and binary refusal actions. Guardrail: Always pair the generated mapping table with a sensitivity analysis that tests boundary cases ±0.05 from each threshold.

02

Good Fit: Audit-Ready Decision Logic

Use when: governance or compliance teams require explainable refusal decisions. Guardrail: Store the generated justification for each threshold boundary alongside the mapping table so auditors can trace why a score of 0.71 triggers refusal but 0.69 does not.

03

Bad Fit: Real-Time Scoring Replacement

Avoid when: you need a prompt to perform the actual risk scoring or classification. This prompt designs the mapping policy, not the upstream classifier. Guardrail: Use a separate safety classification prompt for score generation, then apply this mapping as a post-processing configuration layer.

04

Bad Fit: Single-Threshold Simplicity

Avoid when: your refusal logic is a single hard cutoff with no edge-case handling. This prompt adds unnecessary complexity for simple pass/fail gates. Guardrail: Default to a single threshold unless you have evidence of boundary crowding, category-specific risk tolerance, or A/B test requirements.

05

Required Input: Calibrated Score Distribution

Risk: garbage thresholds from uncalibrated scores. If the upstream classifier produces scores that are not calibrated, threshold boundaries become arbitrary. Guardrail: Require a calibration report or reliability diagram as input context before generating threshold mappings. Reject prompt execution if calibration evidence is missing.

06

Operational Risk: Threshold Drift

Risk: score distributions shift in production, making static thresholds too permissive or too restrictive. Guardrail: Version each mapping table with a validity window and monitoring trigger. When production score distributions drift beyond a configured tolerance, regenerate the mapping with fresh calibration data.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt that maps numeric risk scores to binary refusal decisions with threshold justification and edge-case handling.

This template translates a numeric risk score into a binary refusal decision while producing a structured justification for the chosen threshold boundary. It is designed for product teams who need to define and document the relationship between continuous risk scores and discrete actions. The prompt forces explicit reasoning about edge cases where scores fall near decision boundaries, making the mapping auditable and debuggable rather than a black-box threshold.

text
You are a safety decision analyst. Your task is to map a numeric risk score to a binary refusal decision and produce a structured justification for the threshold boundary.

## INPUT
Risk Score: [RISK_SCORE]
Score Range: [SCORE_RANGE_MIN] to [SCORE_RANGE_MAX]
Risk Category: [RISK_CATEGORY]
User Context: [USER_CONTEXT]

## THRESHOLD CONFIGURATION
Refusal Threshold: [REFUSAL_THRESHOLD]
Threshold Sensitivity Zone: [SENSITIVITY_ZONE] (scores within this range of the threshold require additional scrutiny)

## CONSTRAINTS
- If the risk score is at or above the refusal threshold, the decision must be REFUSE.
- If the risk score is below the refusal threshold but within the sensitivity zone, you must flag the case for review and explain the proximity risk.
- If the risk score is below the threshold and outside the sensitivity zone, the decision must be ALLOW.
- Do not override the threshold based on intuition. If you believe the threshold is wrong for this case, note it in the threshold_feedback field.
- Provide specific evidence from the risk score and category to support your decision.

## OUTPUT SCHEMA
Return a JSON object with this exact structure:
{
  "decision": "REFUSE" | "ALLOW" | "FLAG_FOR_REVIEW",
  "risk_score": number,
  "threshold_applied": number,
  "proximity_to_threshold": number (distance from threshold, negative if below),
  "sensitivity_zone_triggered": boolean,
  "justification": "string explaining why this score maps to this decision",
  "edge_case_analysis": "string describing any boundary concerns or ambiguity",
  "threshold_feedback": "string or null - note if the threshold seems inappropriate for this case",
  "recommended_action": "string - concrete next step for the system or reviewer"
}

## EXAMPLES
[EXAMPLES]

## OUTPUT

Adapt this template by adjusting the threshold configuration block to match your organization's risk tolerance. For high-stakes domains such as healthcare or finance, set a wider sensitivity zone and route all FLAG_FOR_REVIEW cases to human reviewers. The threshold_feedback field is critical for detecting threshold drift: aggregate these notes across decisions to identify when your thresholds need recalibration. Before deploying, validate that the output JSON matches the schema exactly and test edge cases where the risk score equals the threshold value or falls exactly at the sensitivity zone boundary.

IMPLEMENTATION TABLE

Prompt Variables

Inputs required for the Risk Score vs. Refusal Decision Mapping Prompt. Each variable must be supplied at runtime or configured as a system default.

PlaceholderPurposeExampleValidation Notes

[RISK_SCORE]

Numeric risk score from upstream safety classifier

0.87

Must be a float between 0.0 and 1.0. Reject if null, non-numeric, or outside range.

[HARM_CATEGORY]

Category of harm detected by the classifier

self-harm

Must match an enum from the defined harm taxonomy. Reject unknown categories.

[THRESHOLD_CONFIG]

Mapping of harm categories to refusal thresholds

{"self-harm": 0.7, "violence": 0.8}

Must be valid JSON with numeric thresholds per category. Schema check required before prompt assembly.

[BOUNDARY_ZONE_WIDTH]

Margin around threshold where decisions are treated as uncertain

0.05

Must be a float between 0.0 and 0.2. Default to 0.05 if not provided. Controls sensitivity analysis output.

[REQUEST_EXCERPT]

Relevant excerpt of the user request that triggered the score

How can I...

Must be a non-empty string. Truncate to 500 characters. Required for justification generation.

[POLICY_REFERENCE]

Policy clause or rule ID that applies to this harm category

SAF-103

Must be a non-empty string matching a known policy ID. Null allowed if no policy is mapped.

[PREVIOUS_DECISION]

Prior refusal decision for this session, if any

null

Must be 'allow', 'refuse', 'escalate', or null. Used for multi-turn consistency checks.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Risk Score vs. Refusal Decision Mapping prompt into a production safety system with validation, logging, and human review gates.

This prompt is designed to sit between a safety classifier that outputs numeric risk scores and a decision engine that enforces binary allow/block actions. The implementation harness must treat the mapping table as a configuration artifact—not a one-time generation. Store the output as a versioned JSON document in your safety policy repository, with each threshold boundary accompanied by its justification and edge-case handling rules. The mapping table should be loaded at runtime by your decision service, which compares incoming risk scores against the defined buckets and applies the corresponding action. This separation ensures that threshold tuning does not require prompt changes or model redeployment; only the mapping artifact is updated.

Validation and schema enforcement is critical before the mapping table enters production. After the model returns the JSON, validate that every bucket covers a contiguous numeric range with no gaps or overlaps, that boundary values are monotonically increasing, and that each action field matches your allowed enum (e.g., allow, warn, redirect, review, block). Reject any output where the sensitivity_analysis section fails to identify at least one boundary where small score changes would flip the decision. If validation fails, retry the prompt once with the validation errors injected into the [CONSTRAINTS] field. After two failures, escalate to a human reviewer rather than deploying a broken mapping. Logging should capture the full prompt input, the raw model output, the validation result, and the final deployed mapping version. This audit trail is essential for governance reviews and incident postmortems.

Model choice matters. Use a model with strong structured output capabilities and low refusal rates on policy content. GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro are suitable defaults. Avoid small or instruction-tuned-only models that may hallucinate numeric ranges or skip the sensitivity analysis. Set temperature=0 to maximize deterministic threshold placement. If your safety classifier's score distribution shifts over time (e.g., after a model update), re-run this prompt with the new score distribution statistics in [CONTEXT] and compare the resulting mapping against the previous version using a diff tool. Human review is required before any mapping table goes live in a production refusal path. A safety engineer or product policy owner must sign off on the threshold boundaries, the edge-case handling rules, and the sensitivity analysis. Automate the diff presentation but not the approval decision.

Integration pattern: Your decision service should load the mapping table at startup or from a hot-reloadable config store. For each incoming request, extract the risk score from your classifier, iterate through the buckets in order, and return the action for the first bucket whose range contains the score. If no bucket matches, default to the most conservative action (review or block) and fire an alert—this indicates a mapping gap. Monitor the distribution of scores landing in each bucket, especially the boundary-adjacent regions identified in the sensitivity analysis. If more than 5% of scores fall within 0.05 of a threshold boundary, flag for human review and consider adjusting the boundary or adding a review bucket. Do not use this prompt to generate per-request decisions at inference time; it is a configuration-generation tool, not a runtime classifier.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structure, types, and validation rules for the mapping table produced by the Risk Score vs. Refusal Decision Mapping Prompt. Use this contract to parse, validate, and store the output before integrating it into a production gating system.

Field or ElementType or FormatRequiredValidation Rule

thresholds

Array of Objects

Schema check: array length >= 3. Each object must have risk_score, decision, and justification fields.

thresholds[].risk_score

Number (0.0 to 1.0)

Parse check: float. Range check: 0.0 <= value <= 1.0. Monotonicity check: values must be strictly increasing across the array.

thresholds[].decision

Enum String

Schema check: value must be one of allow, warn, redirect, review, block. No custom or null values allowed.

thresholds[].justification

String

Content check: length >= 20 characters. Must reference a policy boundary or harm category. Citation check: must not contain unresolved placeholders.

sensitivity_analysis

Object

Schema check: must contain boundary_cases and recommendation fields. Null not allowed.

sensitivity_analysis.boundary_cases

Array of Objects

Schema check: array length >= 2. Each object must have score_delta, decision_change, and example fields.

sensitivity_analysis.recommendation

String

Content check: length >= 30 characters. Must state a preferred threshold configuration. Approval required: human review before production deployment.

metadata

Object

Schema check: if present, must include generated_at (ISO 8601 timestamp) and version (string). Null allowed if output is a draft.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when mapping risk scores to refusal decisions and how to guard against it.

01

Threshold Boundary Crowding

What to watch: Scores cluster near the decision boundary, causing flip-flopping between allow and refuse on near-identical inputs. A request scoring 0.51 and another scoring 0.49 should not produce radically different outcomes without justification. Guardrail: Implement a hysteresis band or 'gray zone' around the threshold. Route scores within ±0.05 of the cutoff to a clarification prompt or human review queue instead of making an immediate binary decision.

02

Score Calibration Drift After Model Update

What to watch: A new model version produces risk scores with a different distribution—mean shifts, variance changes, or modality collapse—breaking threshold configurations tuned on the previous version. A threshold of 0.7 that worked before may now block 40% of legitimate traffic. Guardrail: Run a calibration regression suite comparing score distributions between old and new model versions on a fixed golden dataset before deploying. Recalibrate thresholds based on observed distribution shifts, not assumptions.

03

Over-Refusal on Benign Edge Cases

What to watch: Legitimate requests containing policy-adjacent language trigger high risk scores and false refusals. A user asking about 'how to secure a server' gets blocked because the classifier overweights the word 'attack' in a nearby sentence. Guardrail: Maintain a false-positive registry of known over-refusal patterns. Implement a secondary 'benign intent' classifier that runs on refused requests and flags potential over-refusals for human review and threshold recalibration.

04

Single-Turn Scoring Missing Multi-Turn Probing

What to watch: An adversary spreads a policy violation across multiple turns—each individual request scores below threshold, but the aggregate sequence constitutes a clear violation. Single-turn scoring produces a false negative. Guardrail: Implement a cumulative session risk score that aggregates evidence across turns. When the cumulative score crosses a lower threshold than the per-turn cutoff, trigger a session-level review or escalate to a human analyst.

05

Uncalibrated Confidence Producing Dangerous Certainty

What to watch: The model assigns a risk score of 0.98 with high confidence but is wrong—the request is benign. The system auto-blocks with no recourse because the confidence estimate was itself uncalibrated. Guardrail: Evaluate confidence calibration separately from classification accuracy. Use Expected Calibration Error on a held-out test set. If confidence exceeds actual accuracy by more than 10%, route high-confidence decisions to a sampled review queue rather than auto-resolving them.

06

Threshold Configuration Without Audit Trail

What to watch: A threshold is changed from 0.6 to 0.4 in production, doubling the refusal rate, but no record exists of who changed it, why, or what impact was expected. Compliance auditors cannot reconstruct the decision logic. Guardrail: Log every threshold change with timestamp, actor, justification, and expected impact. Generate a structured audit record for every refusal decision that includes the input, score, threshold value, and decision rationale. Make this record queryable for compliance reviews.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for evaluating whether the risk-score-to-refusal-decision mapping prompt produces correct, calibrated, and production-safe outputs before deployment.

CriterionPass StandardFailure SignalTest Method

Threshold Boundary Accuracy

All threshold boundaries in the output mapping table match the [THRESHOLD_CONFIG] input values exactly

A boundary value is shifted by more than 0.01 from the configured threshold

Parse the output mapping table and assert each boundary value equals the corresponding value in [THRESHOLD_CONFIG]

Decision Consistency

For each risk score in [TEST_SCORES], the mapped refusal decision matches the expected decision from the reference implementation

Any test score produces a refusal decision that contradicts the threshold logic

Run the prompt against a golden dataset of 50 score-decision pairs and assert 100% agreement

Edge-Case Handling at Boundaries

Scores exactly equal to a threshold value produce the decision specified in [BOUNDARY_POLICY] without ambiguity

A score equal to a threshold produces an inconsistent decision, a null value, or contradictory justification

Inject boundary-value scores and verify the output decision field matches the configured boundary policy for each threshold

Justification Completeness

Every threshold boundary in the output includes a non-empty justification field that references the harm category or policy rationale from [POLICY_CONTEXT]

A justification field is empty, contains only boilerplate text, or fails to reference any policy element

Extract all justification fields and assert each contains at least one reference to a category or clause from [POLICY_CONTEXT]

Sensitivity Analysis Presence

The output includes a sensitivity analysis section that identifies at least one threshold where a small shift would change outcomes for scores in [TEST_SCORES]

The sensitivity analysis section is missing, empty, or identifies no actionable threshold sensitivity

Parse the sensitivity analysis block and assert it contains at least one threshold label and a numeric impact estimate

Output Schema Compliance

The output validates against [OUTPUT_SCHEMA] with all required fields present and correctly typed

Schema validation fails due to missing required fields, incorrect types, or extra fields not in the schema

Validate the full output against [OUTPUT_SCHEMA] using a JSON Schema validator

Refusal Decision Enum Validity

Every refusal decision value in the output is one of the allowed enum values from [DECISION_ENUM]

A decision value appears that is not in the allowed enum list

Extract all decision values and assert each is a member of [DECISION_ENUM]

Score Range Coverage

The mapping table covers the full risk score range from [SCORE_MIN] to [SCORE_MAX] with no gaps between adjacent buckets

A gap exists between the upper bound of one bucket and the lower bound of the next, leaving scores unassigned

Parse bucket boundaries, sort ascending, and assert that each bucket's upper bound equals the next bucket's lower bound

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple JSON schema for the mapping table. Use a single threshold boundary (e.g., 0.5) and focus on getting consistent output structure before tuning sensitivity.

code
[SYSTEM_INSTRUCTION]
You are a safety policy analyst. Given a numeric risk score between 0.0 and 1.0, produce a refusal decision mapping table.

[INPUT]
Risk Score: [RISK_SCORE]
Policy Context: [POLICY_CONTEXT]

[OUTPUT_SCHEMA]
{
  "thresholds": [
    {"boundary": number, "decision": "allow"|"refuse", "justification": string}
  ]
}

Watch for

  • Hardcoded thresholds that don't reflect actual policy nuance
  • Missing edge-case handling near boundary values (e.g., 0.49 vs 0.51)
  • Overly simplistic justifications that don't reference policy clauses
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.