# Prompt Context

Prompt context is the background information supplied to a foundation model to help it interpret a request and produce a relevant response.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/prompt-context

> Context gives a model task-specific facts, conversation history, reference material, or situational details that may not be available from its learned parameters. Selecting relevant, trustworthy context improves response quality, but requires attention to token limits, cost, privacy, and the distinction between supporting information and instructions.

Practice exams covering Prompt Context: [AIB-C01 (beta) AWS Certified AI Business Strategist](https://blowstack.com/practice-exams/aws-certified-ai-business-strategist), [AIF-C01 AWS Certified AI Practitioner](https://blowstack.com/practice-exams/aws-certified-ai-practitioner), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional).

## 6 key aspects of Prompt Context

Effective prompt context is relevant, clearly separated from instructions, appropriately sourced, bounded by token limits, and governed by application security controls.

1. **Task-specific background**: Supply facts that materially affect the answer, such as the applicable policy, environment, audience, or current system state. Prefer explicit details over assuming the model knows an organization's terminology or operating conditions.
2. **Separation from instructions**: Distinguish what the model should do from the information it should use. Keep constraints and negative instructions separate from reference material so quoted text is less likely to be interpreted as an instruction.
3. **Retrieval-based grounding**: Retrieve relevant, authorized evidence at request time and include it in the model input. Preserve source identifiers and freshness information so answers can be checked against the underlying records.
4. **Token-budget management**: Fit useful context within the selected model's limits while leaving sufficient capacity for the response. Filter, deduplicate, or summarize content, and test whether these transformations remove essential details.
5. **Explicit conversation state**: Include the conversation history needed to resolve follow-up questions. Do not assume an inference endpoint remembers earlier requests unless the application or service explicitly manages that state.
6. **Trust and privacy boundaries**: Apply access controls before adding documents or records to context, and minimize sensitive data. Treat retrieved content as potentially hostile and validate model-proposed actions outside the model.

## Cloud services for Prompt Context

A typical contextual application stores reference documents in Amazon S3 and indexes searchable passages in Amazon OpenSearch Service. AWS Lambda authenticates the request through the application's security mechanisms, applies authorization-aware retrieval, and assembles selected passages with the user question and instructions. Amazon Bedrock then performs inference using that context. Knowledge Bases for Amazon Bedrock can manage supported ingestion and retrieval workflows instead of requiring entirely custom orchestration. Across either approach, engineers must control source access, budget tokens, preserve useful source metadata, and validate responses rather than treating retrieved context as a guarantee of correctness.

- **[Amazon Bedrock](https://blowstack.com/tools/cloud-services-hub/amazon-bedrock)**: Amazon Bedrock accepts contextual information through model inference requests. Knowledge Bases for Amazon Bedrock can retrieve source material and augment prompts for retrieval-augmented generation, reducing the amount of custom retrieval orchestration an application must implement.
- **[Amazon OpenSearch Service](https://blowstack.com/tools/cloud-services-hub/amazon-opensearch-service)**: Amazon OpenSearch Service supports keyword and vector search for selecting passages to include as prompt context. Applications must configure and enforce authorization-aware retrieval rather than assume similarity search alone respects each user's document permissions.
- **[Amazon S3](https://blowstack.com/tools/cloud-services-hub/amazon-s3)**: Amazon S3 can store the documents used to build a contextual knowledge collection. Applications or ingestion pipelines must extract and select content before it becomes model context; storing a document in a bucket does not automatically make it available to a model.
- **[AWS Lambda](https://blowstack.com/tools/cloud-services-hub/aws-lambda)**: AWS Lambda can run application logic that retrieves records, checks permissions, assembles prompt context, and invokes a model. It can also trim conversation history and validate outputs before returning a response or executing an action.

## Prompt Context exam questions

Real practice exam questions on Prompt Context, with the correct answer and its explanation.

### Question 1 (AIB-C01 (beta))

**Question:**

A company uses Amazon Bedrock to review travel expense decisions from the previous year. Company rules require each expense to be evaluated under the policy in effect when the expense was incurred, not the policy in effect today. The application supplies the expense dates and the text of all approved policy versions, but removes each version's effective dates when assembling the request. The model sometimes applies newer reimbursement limits to older expenses. Which change would BEST address this problem?

**Correct answer:** Preserve each policy version's effective date range alongside its text and instruct the model to use the version covering each expense's incurred date.

**Explanation:** Effective date ranges provide the situational information needed to select the applicable policy. Connecting those ranges to the expense dates grounds each decision in the correct historical rules.

### Question 2 (AIP-C01)

**Question:**

A manufacturer uses Amazon Bedrock to draft maintenance guidance for industrial controllers. Each request includes the controller model, firmware version, and service date. An approved document repository contains procedures for multiple controller models and firmware versions, including superseded procedures. Each procedure has reliable applicability and effective-date metadata.

During testing, the assistant sometimes recommends a procedure for an older firmware version because that document has a higher semantic similarity score than the applicable procedure. The application currently includes the highest-scoring search results until it reaches its input token budget. The applicable procedures and their required safety notices fit within that budget when selected correctly.

The developer must improve the guidance without changing the foundation model or increasing the token budget. Which change BEST addresses the observed failures?

**Correct answer:** Filter candidate documents by controller model, firmware applicability, and effective date before ranking them. Include the applicable procedure and required safety notices in labeled reference sections, and require the assistant to identify when applicable evidence is unavailable.

**Explanation:** This addresses the underlying context-selection problem. Applicability filters prevent semantically similar but inapplicable procedures from displacing the correct evidence. Including required safety notices preserves essential supporting information within the existing budget, while explicit missing-evidence handling avoids unsupported recommendations.

### Question 3 (AIF-C01)

**Question:**

A construction company uses a foundation model in Amazon Bedrock to draft a status briefing for one building project. The briefing must explain changes from the approved schedule and identify unresolved issues. The company's document collection includes the original approved schedule, recent progress reports, resolved issue logs, and records for other projects. The full collection exceeds the model's context window, but the relevant schedule and status information fit within it. How should the application assemble the reference material for the request?

**Correct answer:** Include the project's approved schedule and relevant current progress and unresolved-issue excerpts, retaining their dates and source labels.

**Explanation:** This supplies the baseline and current evidence needed for the specific task while staying within the context window. Dates and source labels help the model interpret changes and distinguish current information from earlier records.

## Practice Prompt Context in a full exam

Questions on Prompt Context in each practice exam, with every answer option and an explanation for each:

- [AIB-C01 (beta)](https://blowstack.com/practice-exams/aws-certified-ai-business-strategist): 6 questions
- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 1 question
- [AIF-C01](https://blowstack.com/practice-exams/aws-certified-ai-practitioner): 1 question

## What is Prompt Context

Prompt context is the information a foundation model receives to understand the situation surrounding a task. It can include reference documents, previous conversation turns, customer details, retrieved database records, tool results, or descriptions of the intended audience. For example, a support assistant answering a refund question needs the applicable refund policy and relevant purchase details, not just the question itself. Supplying that information allows the model to answer for the specific situation rather than relying only on general patterns learned during training.

Context, instructions, and negative prompts serve different purposes. Context supplies background or evidence, such as a policy stating that unopened items can be returned within 30 days. An instruction specifies what to do, such as determining whether a purchase qualifies and explaining the decision. A negative instruction specifies what to avoid, such as not inventing exceptions. In image generation, a negative prompt commonly describes unwanted visual elements. These components can appear in the same request, but contextual facts are not themselves commands, and negative wording does not guarantee compliance.

In cloud applications, an application layer typically assembles context before invoking a model endpoint. A retrieval-augmented generation application searches an authorized document collection, selects relevant passages, and includes those passages alongside the user question. For an operations assistant, the context might contain the current incident timeline, recent deployment details, and excerpts from an approved runbook. The instruction could ask the model to propose diagnostic steps supported by those excerpts and identify missing information rather than guess.

Clear structure helps the model distinguish evidence from directions. Applications can use supported message roles, labeled sections, or delimiters to separate instructions, retrieved documents, and the user request. Document identifiers and timestamps help communicate provenance and freshness. However, formatting is not a security boundary: retrieved text can contain prompt-injection attempts that tell the model to ignore its instructions. Enforce document permissions before retrieval, treat external content as untrusted data, and independently validate sensitive actions.

Context has a finite capacity. A model's context window limits the tokens it can process, and many models require input and generated output to fit within a shared token budget. More context can increase input charges and processing latency, while irrelevant or contradictory passages can reduce answer quality. Select the most useful evidence, remove duplication, reserve capacity for the response, and evaluate whether summarization loses important conditions or exceptions.

Providing context does not retrain the model or automatically create persistent memory. Applications must supply or explicitly manage conversation history across requests. Context also does not guarantee factual answers: models can misinterpret evidence or generate unsupported details. Test factual support, permission boundaries, and behavior when evidence is absent or conflicting. Avoid placing unnecessary personal data or credentials in prompts, and review logging and retention settings because contextual information may also enter application traces.

## Learn Prompt Context in lessons

3 short lessons on Prompt Context in 3 certification courses.

- AIB-C01 (beta): Prompt Context: supplying relevant background (Premium), https://app.blowstack.com/lessons/prompt-context-supplying-relevant-background-aib-c01
- AIP-C01: Prompt Context: refining evidence for model inputs (Premium), https://app.blowstack.com/lessons/prompt-context-refining-evidence-for-model-inputs-aip-c01
- AIF-C01: Prompt Context: supplying task-specific information (Premium), https://app.blowstack.com/lessons/prompt-context-supplying-task-specific-information-aif-c01
