Describe the bug
CfnHarness.HarnessBedrockModelConfigProperty (module aws-bedrockagentcore) is missing the AdditionalParams property that the live CloudFormation registry schema for AWS::BedrockAgentCore::Harness already exposes on HarnessBedrockModelConfig.
AdditionalParams is the documented mechanism for attaching Amazon Bedrock Guardrails (and other provider-specific Converse parameters) to a harness: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-models.html ("Apply Amazon Bedrock Guardrails" — "add a guardrailConfig object to bedrockModelConfig.additionalParams"). Without it there is no typed way to configure guardrails on a harness at deploy time.
Regression Issue
Last Known Working CDK Library Version
No response
Expected Behavior
HarnessBedrockModelConfigProperty exposes additionalParams?: any so this compiles:
new agentcore.CfnHarness(this, 'Harness', {
harnessName: 'planner',
executionRoleArn: role.roleArn,
model: {
bedrockModelConfig: {
modelId: 'us.anthropic.claude-sonnet-5',
additionalParams: {
guardrailConfig: {
guardrailIdentifier: guardrailArn,
guardrailVersion: '1',
trace: 'enabled',
},
},
},
},
});
Current Behavior
TypeScript rejects the property:
Object literal may only specify known properties, and 'additionalParams' does not exist in type 'HarnessBedrockModelConfigProperty'.
In aws-cdk-lib 2.266.0 and the latest 2.268.0, aws-bedrockagentcore/lib/bedrockagentcore.generated.d.ts defines the property with only:
interface HarnessBedrockModelConfigProperty {
readonly apiFormat?: string;
readonly maxTokens?: number;
readonly modelId: string;
readonly temperature?: number;
readonly topP?: number;
}
The Python API reference shows the same shape (model_id, api_format, max_tokens, temperature, top_p), so all jsii languages are affected.
The CloudFormation registry schema does have the property:
$ aws cloudformation describe-type --type RESOURCE --type-name AWS::BedrockAgentCore::Harness \
--query Schema --output text | jq '.definitions.HarnessBedrockModelConfig.properties | keys'
[
"AdditionalParams",
"ApiFormat",
"MaxTokens",
"ModelId",
"Temperature",
"TopP"
]
The latest published @aws-cdk/aws-service-spec (0.1.210) db.json contains zero occurrences of AdditionalParams, so the gap appears to be in the service-spec snapshot rather than in CloudFormation.
Reproduction Steps
npm i aws-cdk-lib@2.268.0
- Add
additionalParams to model.bedrockModelConfig in a CfnHarness as shown under Expected Behavior.
tsc / cdk synth fails with the type error above.
- Compare with
aws cloudformation describe-type --type RESOURCE --type-name AWS::BedrockAgentCore::Harness (us-west-2), which lists AdditionalParams under HarnessBedrockModelConfig.
Possible Solution
Refresh the AWS::BedrockAgentCore::Harness schema in @aws-cdk/aws-service-spec so the L1 generator emits additionalParams on HarnessBedrockModelConfigProperty (type any / JSON document, matching the data-plane SDK's HarnessBedrockModelConfig.additionalParams?: DocumentType).
Workaround in the meantime:
harness.addPropertyOverride('Model.BedrockModelConfig.AdditionalParams', {
guardrailConfig: { guardrailIdentifier: guardrailArn, guardrailVersion: '1', trace: 'enabled' },
});
Additional Information/Context
The data-plane SDK already models the field: @aws-sdk/client-bedrock-agentcore 3.1119.0 HarnessBedrockModelConfig.additionalParams?: __DocumentType, and a per-invocation InvokeHarness override with additionalParams.guardrailConfig was verified live to return stopReason: guardrail_intervened when the guardrail triggers. The deploy-time CDK path is the only piece missing.
AWS CDK Library version (aws-cdk-lib)
2.266.0 (also reproduced against the 2.268.0 generated typings)
AWS CDK CLI version
2.1139.0
Node.js Version
v24.11.1
OS
macOS 26.6.2
Language
TypeScript
Language Version
TypeScript 5.6
Other information
No response
Describe the bug
CfnHarness.HarnessBedrockModelConfigProperty(moduleaws-bedrockagentcore) is missing theAdditionalParamsproperty that the live CloudFormation registry schema forAWS::BedrockAgentCore::Harnessalready exposes onHarnessBedrockModelConfig.AdditionalParamsis the documented mechanism for attaching Amazon Bedrock Guardrails (and other provider-specific Converse parameters) to a harness: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-models.html ("Apply Amazon Bedrock Guardrails" — "add aguardrailConfigobject tobedrockModelConfig.additionalParams"). Without it there is no typed way to configure guardrails on a harness at deploy time.Regression Issue
Last Known Working CDK Library Version
No response
Expected Behavior
HarnessBedrockModelConfigPropertyexposesadditionalParams?: anyso this compiles:Current Behavior
TypeScript rejects the property:
In
aws-cdk-lib2.266.0 and the latest 2.268.0,aws-bedrockagentcore/lib/bedrockagentcore.generated.d.tsdefines the property with only:The Python API reference shows the same shape (
model_id,api_format,max_tokens,temperature,top_p), so all jsii languages are affected.The CloudFormation registry schema does have the property:
The latest published
@aws-cdk/aws-service-spec(0.1.210)db.jsoncontains zero occurrences ofAdditionalParams, so the gap appears to be in the service-spec snapshot rather than in CloudFormation.Reproduction Steps
npm i aws-cdk-lib@2.268.0additionalParamstomodel.bedrockModelConfigin aCfnHarnessas shown under Expected Behavior.tsc/cdk synthfails with the type error above.aws cloudformation describe-type --type RESOURCE --type-name AWS::BedrockAgentCore::Harness(us-west-2), which listsAdditionalParamsunderHarnessBedrockModelConfig.Possible Solution
Refresh the
AWS::BedrockAgentCore::Harnessschema in@aws-cdk/aws-service-specso the L1 generator emitsadditionalParamsonHarnessBedrockModelConfigProperty(typeany/ JSON document, matching the data-plane SDK'sHarnessBedrockModelConfig.additionalParams?: DocumentType).Workaround in the meantime:
Additional Information/Context
The data-plane SDK already models the field:
@aws-sdk/client-bedrock-agentcore3.1119.0HarnessBedrockModelConfig.additionalParams?: __DocumentType, and a per-invocationInvokeHarnessoverride withadditionalParams.guardrailConfigwas verified live to returnstopReason: guardrail_intervenedwhen the guardrail triggers. The deploy-time CDK path is the only piece missing.AWS CDK Library version (aws-cdk-lib)
2.266.0 (also reproduced against the 2.268.0 generated typings)
AWS CDK CLI version
2.1139.0
Node.js Version
v24.11.1
OS
macOS 26.6.2
Language
TypeScript
Language Version
TypeScript 5.6
Other information
No response