Skip to main content
Back to Prompt Library
Build the complete application

Implementation brief

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build an Enterprise Policy Question-Answering Assistant

Format
Code-aware
Lines
69
Sections
11
Linked challenge
Build an Enterprise Policy Question-Answering Assistant

Prompt source

Original prompt text with formatting preserved for inspection.

69 lines
11 sections
No variables
1 code block
## Who Uses It
An employee seeking an authoritative answer to a workplace policy question.

## What You Will Build
Build an assistant that searches authorized company documents and answers policy questions with source citations. Show the applicable policy version, explain conflicts, and route unresolved questions to the policy owner.

## Inputs
- Policy documents with access labels
- Employee role and question
- Policy ownership and version metadata

## Workflow
1. Filter documents using the requesting user permissions.
2. Retrieve relevant policy sections.
3. Resolve authority, scope, and effective dates.
4. Answer with citations or create a clarification request.

## Interface
A chat interface with clickable evidence, policy version details, conflict notices, and a clarification action.

## Working Demo
Answer 150 with a citation to P1, explain the conflicting chat message, and omit the restricted note.

## Deliverables
- A working local application with the specified review interface.
- Source code, dependency lockfile, and setup commands.
- A recorded end-to-end demo using the supplied starter data.
- Example outputs, action logs, and automated tests.

## Starter Data
These fictional records are a small development fixture, not a production dataset. Implement the mock services described in the brief.

```json
{
  "requester": {
    "role": "employee"
  },
  "question": "What is the hotel nightly limit?",
  "documents": [
    {
      "id": "P1",
      "allowed_roles": [
        "employee"
      ],
      "authority": "approved_policy",
      "version": 2,
      "text": "The hotel limit is 150 per night."
    },
    {
      "id": "M1",
      "allowed_roles": [
        "employee"
      ],
      "authority": "chat_message",
      "text": "I heard the hotel limit is 200."
    },
    {
      "id": "P2",
      "allowed_roles": [
        "finance-admin"
      ],
      "authority": "restricted_note",
      "text": "Confidential exception details."
    }
  ],
  "policy_owner": "Travel Operations"
}
```

## Constraints
Use supplied synthetic documents. Enforce access filters before retrieval, not only during answer generation.
Choose an available model that supports your implementation. Record its identifier and version.

## Evaluation
Review the complete application, not only the starter-case answers.
- The answer cites the approved policy and its version.
- Restricted text does not appear in the answer.
- The user can request clarification from the named policy owner.
Add one normal case, one incomplete-input case, and one failure-recovery case.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Preserve the source structure until you know which part of the prompt is actually driving the result quality.

Tune next

Change domain facts, examples, and tool context first before you rewrite the instruction scaffold.

Verify after

Validate one failure mode at a time so prompt changes stay attributable instead of getting noisy.