Inferensys

Prompt

Constraint-Elicitation Prompt for Agent Goals

A practical prompt playbook for using Constraint-Elicitation Prompt for Agent Goals in production AI workflows.
Engineer reviewing agent handoff workflow on laptop, task routing diagrams visible, technical office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job, ideal user, required context, and boundaries for the constraint-elicitation prompt.

This prompt is designed for the pre-planning clarification phase of an agent workflow. Its job is to take an ambiguous, under-specified user goal and transform it into a well-scoped objective with explicit constraints, boundaries, and success criteria. The ideal user is a developer or product manager building an agent frontend—the interface layer that sits between a human user's natural-language request and the planning module that generates executable steps. Without this clarification step, planning modules receive vague inputs and produce plans that are either too narrow, too broad, or misaligned with what the user actually intended. The prompt is not a planner itself; it is a constraint elicitor that produces a clarified goal document ready for downstream plan generation.

When to use this prompt: You have a user-facing agent that accepts free-text goals (e.g., 'research competitors,' 'optimize my cloud costs,' 'draft a contract'), and you need to extract implicit constraints before planning begins. Use it when the cost of a bad plan is high—either in tokens, tool calls, or real-world side effects. When not to use this prompt: Do not use it for well-structured, form-based inputs where constraints are already explicit (e.g., a configuration wizard). Do not use it for trivial single-step tasks where clarification adds more latency than value. Do not use it when the user expects immediate execution and the clarification loop would degrade the experience. This prompt is also inappropriate for high-stakes domains (healthcare, legal, finance) unless the clarified goal is reviewed by a human before planning proceeds.

Required inputs and context: The prompt expects a raw user goal string and, optionally, any available context about the user's environment, tools, or prior interactions. It works best when paired with a tool manifest or capability description so it can identify constraints the user hasn't mentioned (e.g., 'you didn't specify a budget, but the available tools have rate limits of X calls per minute'). The output is a structured goal document containing: a refined objective statement, explicit constraints (budgets, deadlines, permissions, scope boundaries), identified ambiguities that need resolution, and a confidence score. Next step after using this prompt: Feed the clarified goal into a plan-generation prompt. If the confidence score is low or unresolved ambiguities remain, route to a human for clarification before planning.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if constraint elicitation is the right step before planning.

01

Good Fit: Ambiguous User Goals

Use when: Users express goals like 'optimize my cloud costs' or 'improve security' without specifying scope, budget, or acceptable trade-offs. Guardrail: Run this prompt before any planning step to convert vague intent into a scoped objective with explicit boundaries.

02

Bad Fit: Fully Specified API Calls

Avoid when: The user provides a complete, machine-readable specification with all parameters, constraints, and success criteria already defined. Guardrail: Skip elicitation and proceed directly to plan generation to avoid unnecessary latency and token cost.

03

Required Inputs

What you need: The original user request, available tool manifest, agent capability boundaries, and any organizational policies that constrain execution. Guardrail: If tool definitions or policy documents are missing, the prompt will produce constraints that cannot be validated against real capabilities.

04

Operational Risk: Over-Constraint

Risk: The prompt may invent constraints the user never intended, narrowing the solution space unnecessarily and blocking valid execution paths. Guardrail: Always present elicited constraints back to the user for confirmation before locking them into a plan.

05

Operational Risk: Missing Constraints

Risk: Implicit constraints like regulatory requirements, data residency rules, or latency budgets may remain unstated and cause downstream failures. Guardrail: Include a checklist of common constraint categories (budget, time, permissions, compliance, quality) and flag any category with no elicited value.

06

Latency and Cost Trade-Off

Risk: Adding a constraint elicitation step increases end-to-end latency and token consumption, especially for simple requests. Guardrail: Implement a fast-path classifier that routes well-specified requests directly to planning and only invokes elicitation when ambiguity exceeds a threshold.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt that extracts implicit constraints from ambiguous user goals before any planning begins.

This template is designed to sit between a user's natural-language request and your agent's planning module. Its job is to surface what the user left unsaid—budget limits, deadline pressure, permission boundaries, quality expectations, and non-negotiable constraints—before the planner commits to a course of action. Use it when user goals arrive as short, vague, or emotionally loaded statements (e.g., "optimize our pipeline" or "fix the onboarding flow"). Do not use it when the user has already provided a structured specification with explicit constraints; in that case, pass the specification directly to the planner and skip the elicitation overhead.

text
You are a constraint-elicitation assistant. Your only job is to take an ambiguous user goal and produce a clarified version with explicit constraints. Do not solve the goal. Do not generate a plan. Do not recommend actions.

## Input
User goal: [USER_GOAL]
Available tools and capabilities: [AVAILABLE_TOOLS]
Known organizational context: [ORG_CONTEXT]
Risk tolerance level: [RISK_LEVEL]

## Task
Analyze the user goal and identify what is missing or ambiguous. For each gap, formulate a specific, answerable question that would resolve the ambiguity. Then produce a clarified goal statement that incorporates reasonable defaults for any gap you cannot resolve, marked with [ASSUMPTION: ...] tags.

## Output Schema
Return valid JSON only:
{
  "original_goal": "string",
  "clarified_goal": "string with [ASSUMPTION: ...] tags where defaults were used",
  "identified_gaps": [
    {
      "gap": "string describing what is missing",
      "clarification_question": "string question to ask the user",
      "default_assumption": "string or null if no reasonable default exists",
      "risk_if_wrong": "low | medium | high | critical"
    }
  ],
  "explicit_constraints": {
    "budget": "string or null",
    "deadline": "string or null",
    "permission_scope": "string or null",
    "quality_threshold": "string or null",
    "non_negotiables": ["string"],
    "excluded_actions": ["string"]
  },
  "requires_user_clarification": true,
  "safe_to_proceed_with_defaults": false
}

## Constraint Categories to Probe
1. Budget: Money, tokens, compute, or human time the user is willing to spend.
2. Deadline: When this must be done and consequences of lateness.
3. Permission scope: What the agent is allowed to read, modify, delete, or create.
4. Quality threshold: Minimum acceptable accuracy, completeness, or polish.
5. Non-negotiables: Constraints the user would rather abort than violate.
6. Excluded actions: Things the agent must never do, even if they seem efficient.
7. Stakeholders: Who else cares about the outcome and what they value.
8. Reversibility: Whether actions must be undoable or can be permanent.

## Rules
- If a gap has no reasonable default, set default_assumption to null and set safe_to_proceed_with_defaults to false.
- Mark risk_if_wrong as "critical" for gaps involving data deletion, financial transactions, external communication, or privacy.
- Never invent facts about the user's situation. Use [ORG_CONTEXT] if provided; otherwise, flag missing context as a gap.
- If the goal is too vague to clarify even with defaults, set requires_user_clarification to true and safe_to_proceed_with_defaults to false.

Adaptation guidance: Replace [USER_GOAL] with the raw user input. Populate [AVAILABLE_TOOLS] from your agent's tool manifest—this prevents the elicitation from probing constraints irrelevant to your capabilities. [ORG_CONTEXT] should carry persistent facts like team size, industry, and known policies; pull this from session memory or a user profile. Set [RISK_LEVEL] to low, medium, or high based on the domain (e.g., high for finance or healthcare). If your agent framework already has a structured constraint schema, replace the explicit_constraints block with your own fields. The output JSON is designed to feed directly into a planning module: pass clarified_goal as the planner's objective and explicit_constraints as its boundary conditions. If requires_user_clarification is true, route back to the user with the clarification_question list before invoking the planner.

IMPLEMENTATION TABLE

Prompt Variables

Placeholders required by the constraint-elicitation prompt. Each variable must be populated before the prompt is sent to the model. Missing or poorly formed inputs are the most common cause of incomplete constraint extraction.

PlaceholderPurposeExampleValidation Notes

[USER_GOAL]

The raw, ambiguous user request that needs constraint extraction

I need a report on our competitors

Must be non-empty string. Check for length < 20 chars as signal of under-specification. If null, abort prompt assembly.

[AGENT_CAPABILITY_LIST]

The set of tools, APIs, and actions the agent can perform

web_search, file_read, database_query, email_send

Must be a valid JSON array of strings. Each string must match an entry in the tool registry. Validate against tool manifest before prompt assembly.

[DOMAIN_CONTEXT]

Optional business or operational context that constrains what the agent should consider

B2B SaaS competitive intelligence for pricing team

Allow null. If provided, must be string under 500 tokens. Check for contradictory statements with [USER_GOAL].

[CONSTRAINT_CATEGORIES]

The dimensions of constraint the prompt should elicit

budget, deadline, permission_scope, data_sources, output_format, risk_tolerance

Must be a valid JSON array of strings. Each category must match a known constraint type in the system. Minimum 3 categories required.

[OUTPUT_SCHEMA]

The strict JSON schema the clarified goal must conform to

See constraint-output-schema.json in harness

Must be a valid JSON Schema object. Validate with ajv before prompt assembly. Schema must include required fields: goal_statement, constraints, assumptions, ambiguities.

[MAX_CLARIFICATION_ROUNDS]

The maximum number of back-and-forth clarification questions the prompt may generate

3

Must be an integer between 1 and 5. Values above 5 risk user abandonment. If null, default to 3.

[HUMAN_APPROVAL_REQUIRED]

Whether the clarified goal must be shown to a human before planning begins

Must be boolean. If true, ensure approval queue is configured and [APPROVAL_ROUTING_KEY] is set in the harness.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the constraint-elicitation prompt into an agent frontend with validation, retries, and human review gates.

This prompt is designed to sit at the entry point of an agent planning pipeline, before any task decomposition or tool selection occurs. It transforms an ambiguous user request into a structured, clarified goal with explicit constraints, budgets, deadlines, and permission scopes. The implementation harness must treat this prompt as a pre-processing gate: if the output fails validation or contains unresolved ambiguities, the system should not proceed to planning. Instead, it should loop back to the user for clarification or escalate to a human reviewer. The prompt is stateless by design—it does not require conversation history or session context—but the harness should store the clarified goal as a structured object that downstream planning modules consume.

Wire the prompt into your application as a synchronous validation step with the following flow: (1) Receive user input and inject it into the [USER_REQUEST] placeholder along with any available [TOOL_CATALOG], [ORGANIZATIONAL_POLICIES], and [RISK_LEVEL] context. (2) Call the model with response_format set to the JSON schema defined in the prompt template. (3) Validate the output against a constraint completeness checklist: every field in the schema must be populated or explicitly marked as "not_applicable"; no field should contain the original ambiguous phrasing; the permission_scope must enumerate specific allowed and disallowed actions. (4) If validation fails, construct a targeted clarification question from the ambiguities_flagged array and present it to the user. Retry up to two times with the clarified input before escalating. (5) On success, serialize the clarified goal object and pass it to the plan generation module. Log the raw user input, the clarified output, and the validation result for audit trails and prompt regression testing.

For high-risk domains (finance, healthcare, legal, infrastructure operations), insert a human review gate after validation succeeds but before the clarified goal is released to the planning engine. The review interface should display the original user request side-by-side with the model's clarified output, highlighting any fields where the model made inferences or filled gaps. The reviewer can approve, edit, or reject the clarification. Rejections should trigger a structured feedback loop that improves future clarifications. For model choice, prefer models with strong instruction-following and structured output support (GPT-4o, Claude 3.5 Sonnet, or equivalent). Avoid smaller models that may collapse the constraint categories or hallucinate tool capabilities. Set temperature to 0 or near-zero to maximize consistency across repeated runs. Do not use RAG for this prompt—the constraint elicitation relies on the model's reasoning over the user's request and known policies, not external knowledge retrieval. If your agent frontend supports tool definitions, you can optionally pass the available tool list in [TOOL_CATALOG] to help the model identify permission boundaries, but the prompt should still work without it by marking unknown tools as requiring clarification.

IMPLEMENTATION TABLE

Expected Output Contract

The clarified goal object that the constraint-elicitation prompt must return. Every field is validated before the plan generator receives this contract.

Field or ElementType or FormatRequiredValidation Rule

goal_statement

string (1-3 sentences)

Must not be identical to [USER_REQUEST]. Must resolve at least one ambiguity from the original request.

explicit_constraints

array of constraint objects

Array length >= 1. Each object must have 'type', 'value', and 'source' fields. 'source' must be 'user', 'derived', or 'assumed'.

constraints[].type

enum: budget, deadline, scope, permission, quality, format, dependency

Must match enum exactly. Reject unknown constraint types.

constraints[].value

string or number

Must be parseable. Budget values must include currency or unit. Deadline values must be ISO 8601 or relative duration.

constraints[].source

enum: user, derived, assumed

At least one constraint must have source 'user'. More than 50% 'assumed' triggers a clarification request to the user.

success_criteria

array of strings (1-5 items)

Each criterion must be falsifiable. Vague criteria like 'good quality' must be rejected. Minimum 1 criterion.

boundaries.excluded_actions

array of strings

If present, each string must describe a specific action the agent must not perform. Null allowed.

ambiguities_resolved

array of objects with 'original_ambiguity' and 'resolution'

Array length >= 1. Each resolution must cite evidence from [USER_REQUEST] or state 'assumed: [rationale]'.

PRACTICAL GUARDRAILS

Common Failure Modes

Constraint-elicitation prompts fail in predictable ways. Here are the most common failure modes and how to guard against them.

01

Silent Constraint Omission

What to watch: The model accepts an ambiguous goal without surfacing missing constraints, producing a plan that assumes defaults the user never intended. This is the most dangerous failure because it looks correct. Guardrail: Require the prompt to output an explicit 'Assumptions' block and a 'Missing Constraints' list. If either is empty for a non-trivial goal, flag for human review.

02

Over-Constraint Hallucination

What to watch: The model invents constraints that the user never stated, such as budget caps, deadline pressure, or permission boundaries, then builds a plan around those fabricated limits. Guardrail: Add a directive to ground every elicited constraint in user-provided text or explicit inference markers. Validate that no constraint appears without a source reference.

03

Constraint Conflict Blindness

What to watch: The model accepts mutually exclusive constraints without flagging the conflict, producing a plan that is impossible to execute. For example, 'complete by Friday' and 'no parallel work' when the task requires 80 hours. Guardrail: Include a conflict-detection step in the prompt that explicitly checks pairs of constraints for logical or temporal incompatibility before plan generation.

04

Permission Scope Creep

What to watch: The model fails to elicit boundaries on what the agent is allowed to do, defaulting to maximum permissiveness. This leads to plans that modify production data, send external emails, or incur costs without authorization. Guardrail: Require the prompt to produce an explicit 'Permission Scope' section with allow/deny lists. If the user hasn't specified, the default must be read-only and sandboxed.

05

Ambiguity Preservation

What to watch: The model rephrases the user's ambiguous request without resolving the ambiguity, producing a clarified goal that is just as vague as the input. 'Make it better' becomes 'Improve the system' with no measurable criteria. Guardrail: Require every elicited constraint to be testable. Add a self-check: 'For each constraint, can a downstream system determine whether it has been satisfied?' If not, flag for clarification.

06

Budget and Deadline Neglect

What to watch: The model focuses on functional constraints while ignoring resource constraints—token budgets, wall-clock deadlines, API call limits, or monetary costs. The resulting plan is technically correct but operationally infeasible. Guardrail: Add mandatory fields for resource budgets in the output schema. If the user hasn't provided them, the prompt must insert conservative defaults and mark them as assumed.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test whether the constraint-elicitation prompt reliably reduces ambiguity and surfaces implicit constraints before planning begins. Each criterion targets a specific failure mode observed in production agent frontends.

CriterionPass StandardFailure SignalTest Method

Constraint Completeness

Output contains explicit values for budget, deadline, permission scope, and success criteria when the user goal implies them

Missing constraint category that was clearly implied by the user request (e.g., no budget when user mentioned cost sensitivity)

Run 20 ambiguous user goals through the prompt; check that all 4 constraint categories appear in output when source goal implies them

Ambiguity Reduction

Output replaces vague terms (soon, cheap, good) with specific ranges or thresholds

Vague qualifier from input appears unchanged in output without a clarifying range or threshold

Scan output for presence of input vagueness markers; flag if more than 10% of vague terms survive without clarification

Assumption Logging

Output includes an explicit assumptions section listing at least 1 assumption when the user goal is underspecified

No assumptions listed for a goal that is clearly missing critical information (e.g., target audience, platform, scale)

Feed 10 deliberately underspecified goals; require at least 1 assumption per output; fail if any output has zero assumptions

Constraint Source Attribution

Each constraint is tagged with source: user-stated, inferred, or assumed

Constraints appear without source tags, making it impossible to distinguish user requirements from model guesses

Parse output for constraint-source field; fail if any constraint object is missing the source attribute

Refusal to Guess Critical Constraints

Prompt returns a clarification request instead of inventing values for safety-critical or irreversible constraints

Output confidently assigns a specific value to a constraint that requires user confirmation (e.g., spending limit, data retention policy)

Test with goals containing high-stakes gaps; check that output contains a clarification question rather than a fabricated constraint

Output Schema Compliance

Output matches the required JSON schema with all required fields present and correctly typed

Missing required field, wrong type, or extra fields that violate the schema contract

Validate output against JSON Schema; fail on any schema violation; measure pass rate across 50 runs

Constraint Conflict Detection

Output flags when two constraints are mutually exclusive or cannot be satisfied together

Output silently accepts contradictory constraints without noting the conflict

Feed goals with embedded conflicts (e.g., maximum quality and minimum cost); check that output contains a conflict flag or clarification request

Permission Scope Boundaries

Output defines what the agent is explicitly allowed and not allowed to do, with deny-listed actions when relevant

Permission scope is missing, overly broad, or contains only allow-list without deny-list for sensitive domains

Check output for both allow and deny fields in permission scope; fail if deny field is empty when goal involves mutable resources or external services

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and a simple text input/output loop. Skip strict schema validation initially. Focus on whether the model surfaces hidden constraints the user didn't state.

Add a lightweight output check: does the clarified goal contain at least one explicit boundary, budget, deadline, or permission scope that was absent from the original request?

Watch for

  • The model accepting vague inputs without pushing back
  • Overly broad permission scopes ("do whatever it takes")
  • Missing budget or deadline fields when the user implies urgency
  • The model inventing constraints the user never implied
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.