> **Experimental**
>
> `@aws-cdk/aws-bedrock-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# PromptOverrideConfiguration

Configuration for overriding prompt templates and behaviors in different parts of an agent's sequence.

This allows customizing how the agent processes inputs,
makes decisions, and generates responses.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`bedrock/agents/prompt-override.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-bedrock-alpha/bedrock/agents/prompt-override.ts#L234)

## Example

```ts
const agent = new bedrock.Agent(this, 'Agent', {
  foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
  instruction: 'You are a helpful assistant.',
  promptOverrideConfiguration: bedrock.PromptOverrideConfiguration.fromSteps([
    {
      stepType: bedrock.AgentStepType.ROUTING_CLASSIFIER,
      stepEnabled: true,
      customPromptTemplate: 'Your routing template here',
      foundationModel: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_V2
    } as bedrock.PromptRoutingClassifierConfigCustomParser
  ])
});
```

## Properties

- `knowledgeBaseResponseGenerationStep`: [PromptKnowledgeBaseResponseGenerationConfigCustomParser](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptKnowledgeBaseResponseGenerationConfigCustomParser.html) — Configuration for the knowledge base response generation step.

- `memorySummarizationStep`: [PromptMemorySummarizationConfigCustomParser](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptMemorySummarizationConfigCustomParser.html) — Configuration for the memory summarization step.

- `orchestrationStep`: [PromptOrchestrationConfigCustomParser](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptOrchestrationConfigCustomParser.html) — Configuration for the orchestration step.

- `parser`: [IFunction](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.IFunction.html) — The custom Lambda parser function to use.

  The Lambda parser processes and interprets the raw foundation model output.
  It receives an input event with:
  - messageVersion: Version of message format (1.0)
  - agent: Info about the agent (name, id, alias, version)
  - invokeModelRawResponse: Raw model output to parse
  - promptType: Type of prompt being parsed
  - overrideType: Type of override (OUTPUT_PARSER)

  The Lambda must return a response that the agent uses for next actions.

- `postProcessingStep`: [PromptPostProcessingConfigCustomParser](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptPostProcessingConfigCustomParser.html) — Configuration for the post-processing step.

- `preProcessingStep`: [PromptPreProcessingConfigCustomParser](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptPreProcessingConfigCustomParser.html) — Configuration for the pre-processing step.

- `routingClassifierStep`: [PromptRoutingClassifierConfigCustomParser](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.PromptRoutingClassifierConfigCustomParser.html) — Configuration for the routing classifier step.

## Methods

- `fromSteps(steps: PromptStepConfigBase[]): PromptOverrideConfiguration // chainable` (static) — Creates a PromptOverrideConfiguration from individual step configurations.

  Use this method when you want to override prompts without using a custom parser.

  **Parameters**

  - `steps` — The step configurations to use.

  **Returns:** A new PromptOverrideConfiguration instance

- `withCustomParser(props: CustomParserProps): PromptOverrideConfiguration // chainable` (static) — Creates a PromptOverrideConfiguration with a custom Lambda parser function.

  **Parameters**

  - `props` — Configuration including: - `parser`: Lambda function to use as custom parser - Individual step configurations.
