@aws/nx-plugin-mcp 1.0.15 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -55949,6 +55949,14 @@ const generatorsJsonEntries = {
|
|
|
55949
55949
|
"metric": "g30",
|
|
55950
55950
|
"guidePages": ["ts-agent"]
|
|
55951
55951
|
},
|
|
55952
|
+
"ts#agent#guardrails": {
|
|
55953
|
+
"factory": "./src/ts/agent/guardrails/generator",
|
|
55954
|
+
"schema": "./src/ts/agent/guardrails/schema.json",
|
|
55955
|
+
"description": "Add an Amazon Bedrock Guardrail to a TypeScript Agent",
|
|
55956
|
+
"metric": "g76",
|
|
55957
|
+
"guidePages": ["ts-agent-guardrails"],
|
|
55958
|
+
"experimental": true
|
|
55959
|
+
},
|
|
55952
55960
|
"ts#agent#mcp-connection": {
|
|
55953
55961
|
"factory": "./src/ts/agent/mcp-connection/generator",
|
|
55954
55962
|
"schema": "./src/ts/agent/mcp-connection/schema.json",
|
|
@@ -19,7 +19,7 @@ Four built-in namespaces are used by generated constructs:
|
|
|
19
19
|
- **API URLs** — registered automatically by API constructs
|
|
20
20
|
- **Cognito settings** — registered automatically by the UserIdentity construct
|
|
21
21
|
- **Agent runtime ARNs** — added by the connection generator when you connect a React website to an Agent
|
|
22
|
-
- **`agentcore`** — AgentCore runtime ARNs for agents and MCP servers
|
|
22
|
+
- **`agentcore`** — AgentCore runtime ARNs for agents and MCP servers, and the guardrail ID and version of each agent guarded with `ts#agent#guardrails`. Registered automatically by the agent/MCP and guardrail constructs and used for server-side discovery (agent → agent via A2A, agent → MCP server).
|
|
23
23
|
- **`dynamodb`** — table names, registered automatically by DynamoDB table constructs and read by the generated table client.
|
|
24
24
|
- **`database`** — Aurora connection details, registered automatically by relational database constructs and read by the generated database client.
|
|
25
25
|
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TypeScript Agent Guardrails
|
|
3
|
+
description: Attach an Amazon Bedrock Guardrail to a TypeScript Strands Agent
|
|
4
|
+
generator: ts#agent#guardrails
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import { FileTree } from '@astrojs/starlight/components';
|
|
8
|
+
import GeneratorParameters from '@components/generator-parameters.astro';
|
|
9
|
+
import Infrastructure from '@components/infrastructure.astro';
|
|
10
|
+
import Link from '@components/link.astro';
|
|
11
|
+
import NxCommands from '@components/nx-commands.astro';
|
|
12
|
+
import RunGenerator from '@components/run-generator.astro';
|
|
13
|
+
|
|
14
|
+
Attach an [Amazon Bedrock Guardrail](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html) to a <Link path="guides/ts-agent">TypeScript Agent</Link>. A guardrail is a set of rules that Amazon Bedrock applies to the messages your agent sends to the model and to the model's answers. Without one, a user can ask your agent about any topic, and the model can repeat personal data such as email addresses back in its answers.
|
|
15
|
+
|
|
16
|
+
The generator adds a policy file that holds your rules, the code that applies the guardrail to your agent's model, and the infrastructure that creates the guardrail in your AWS account.
|
|
17
|
+
|
|
18
|
+
## How this works
|
|
19
|
+
|
|
20
|
+
- `guardrail.json` next to your `agent.ts` holds the rules: the topics your agent must refuse and the types of personal data (PII, personally identifiable information) it must hide or block.
|
|
21
|
+
- Your CDK construct or Terraform module reads `guardrail.json` when you synthesize or plan. It creates the guardrail and a numbered version of it. A guardrail version is a read-only snapshot of the rules.
|
|
22
|
+
- The infrastructure writes the guardrail's ID and version number to <Link path="guides/runtime-config">runtime config</Link>, the AWS AppConfig application where your infrastructure stores the details of deployed resources. The entry is `agentcore.guardrails.<AgentClass>`, named after your agent's class, for example `agentcore.guardrails.MyAgent`. Each guarded agent has its own entry.
|
|
23
|
+
- `guardrail.ts` builds the Bedrock model that your `new Agent({...})` call uses. Before each model call, the model reads the agent's entry from runtime config and applies that guardrail.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Generate Agent Guardrails
|
|
28
|
+
|
|
29
|
+
You will need an existing TypeScript project containing an agent created with the `ts#agent` generator.
|
|
30
|
+
|
|
31
|
+
<RunGenerator generator="ts#agent#guardrails" />
|
|
32
|
+
|
|
33
|
+
### Options
|
|
34
|
+
|
|
35
|
+
<GeneratorParameters generator="ts#agent#guardrails" />
|
|
36
|
+
|
|
37
|
+
## Generator Output
|
|
38
|
+
|
|
39
|
+
The generator adds the following files next to your agent, where `<agent>` is the name of your agent component (`agent` by default):
|
|
40
|
+
|
|
41
|
+
<FileTree>
|
|
42
|
+
- \<your-project>/src/\<agent>/
|
|
43
|
+
- agent.ts Your agent, now created with `model: getGuardrailedModel()`
|
|
44
|
+
- guardrail.json The rules your guardrail applies
|
|
45
|
+
- guardrail.ts Builds the Bedrock model with the guardrail applied
|
|
46
|
+
</FileTree>
|
|
47
|
+
|
|
48
|
+
It also adds the infrastructure for your selected `iac` provider, where `<agent-name>` is the kebab-case name of your agent's construct or module:
|
|
49
|
+
|
|
50
|
+
<Infrastructure>
|
|
51
|
+
<Fragment slot="cdk">
|
|
52
|
+
<FileTree>
|
|
53
|
+
- packages/common/constructs/src/app/guardrails/\<agent-name>/
|
|
54
|
+
- \<agent-name>-guardrail.ts CDK construct containing the guardrail and its version
|
|
55
|
+
</FileTree>
|
|
56
|
+
</Fragment>
|
|
57
|
+
<Fragment slot="terraform">
|
|
58
|
+
<FileTree>
|
|
59
|
+
- packages/common/terraform/src/app/guardrails/\<agent-name>/
|
|
60
|
+
- \<agent-name>-guardrail.tf Terraform module containing the guardrail and its version
|
|
61
|
+
</FileTree>
|
|
62
|
+
</Fragment>
|
|
63
|
+
</Infrastructure>
|
|
64
|
+
|
|
65
|
+
The generator edits `agent.ts` like this:
|
|
66
|
+
|
|
67
|
+
```diff lang="ts"
|
|
68
|
+
+import { getGuardrailedModel } from './guardrail.js';
|
|
69
|
+
import { Agent, tool } from '@strands-agents/sdk';
|
|
70
|
+
|
|
71
|
+
export const getAgent = async () => {
|
|
72
|
+
const agent = new Agent({
|
|
73
|
+
+ model: getGuardrailedModel(),
|
|
74
|
+
systemPrompt: `You are a mathematical wizard.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Running the generator again on the same agent changes no file, and it keeps your edits to `guardrail.json`.
|
|
78
|
+
|
|
79
|
+
If your agent was generated with `infra: none`, the generator adds only the agent files and prints a warning. You then create the guardrail yourself and write its ID and version to runtime config at `agentcore.guardrails.<AgentClass>` as `{ guardrailId, guardrailVersion }`.
|
|
80
|
+
|
|
81
|
+
### An agent that already sets a model
|
|
82
|
+
|
|
83
|
+
If your `new Agent({...})` call already sets `model`, the generator leaves `agent.ts` unchanged. It prints the file name and the lines to add. To keep your own model options, create your model with the `GuardrailedBedrockModel` class from `guardrail.ts`. It takes the same options as `BedrockModel`, for example:
|
|
84
|
+
|
|
85
|
+
```ts title="agent.ts"
|
|
86
|
+
import { GuardrailedBedrockModel } from './guardrail.js';
|
|
87
|
+
|
|
88
|
+
const agent = new Agent({
|
|
89
|
+
model: new GuardrailedBedrockModel({ modelId: 'my-model-id' }),
|
|
90
|
+
// ...
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## What the guardrail checks
|
|
95
|
+
|
|
96
|
+
The guardrail checks two things on every model call:
|
|
97
|
+
|
|
98
|
+
- the conversation your agent sends to the model, including the user's latest message
|
|
99
|
+
- the model's answer, before your agent streams it back to the user
|
|
100
|
+
|
|
101
|
+
When the guardrail blocks a user's message, the user gets the `blockedInputMessaging` text, and the model is not called. Strands also replaces the blocked message in the agent's conversation history with `[User input redacted.]`. When it blocks an answer, the user gets the `blockedOutputsMessaging` text. When an `ANONYMIZE` rule matches, the answer contains a placeholder such as `{EMAIL}` instead of the value.
|
|
102
|
+
|
|
103
|
+
The guardrail does not check tool definitions, the arguments the model passes to your tools, or the results your tools return. For example, if a tool returns a customer's email address from a database, the guardrail does not hide it from the model. Treat tool results as untrusted, as the <Link path="guides/ts-agent">TypeScript Agent guide</Link> describes under "Securing your Agent".
|
|
104
|
+
|
|
105
|
+
## Editing guardrail.json
|
|
106
|
+
|
|
107
|
+
The vended policy is an example for the generated maths agent. It refuses investment advice and hides or blocks three types of personal data:
|
|
108
|
+
|
|
109
|
+
```json title="guardrail.json"
|
|
110
|
+
{
|
|
111
|
+
"blockedInputMessaging": "Sorry, I can't help with that request.",
|
|
112
|
+
"blockedOutputsMessaging": "Sorry, I can't share that answer.",
|
|
113
|
+
"deniedTopics": [
|
|
114
|
+
{
|
|
115
|
+
"name": "Investment advice",
|
|
116
|
+
"definition": "Recommendations about which specific stocks, funds or other investments to buy or sell.",
|
|
117
|
+
"examples": ["Which stocks should I buy this year?"]
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"piiEntities": [
|
|
121
|
+
{ "type": "EMAIL", "action": "ANONYMIZE" },
|
|
122
|
+
{ "type": "PHONE", "action": "ANONYMIZE" },
|
|
123
|
+
{ "type": "US_SOCIAL_SECURITY_NUMBER", "action": "BLOCK" }
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The fields are:
|
|
129
|
+
|
|
130
|
+
- `blockedInputMessaging`: the reply a user gets when the guardrail blocks their message. At most 500 characters.
|
|
131
|
+
- `blockedOutputsMessaging`: the reply a user gets when the guardrail blocks the model's answer. At most 500 characters.
|
|
132
|
+
- `deniedTopics`: topics your agent must refuse. Each topic has a `name` (at most 100 letters, digits, spaces and the characters `-_!?.`), a `definition` of at most 1000 characters that describes the topic, and optional `examples` of at most 100 characters each.
|
|
133
|
+
- `piiEntities`: types of personal data to act on. `type` is a [sensitive information type](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-sensitive-filters.html) such as `EMAIL`, `PHONE` or `US_SOCIAL_SECURITY_NUMBER`. `action` is `ANONYMIZE` to replace the value with a placeholder, or `BLOCK` to block the whole message or answer.
|
|
134
|
+
|
|
135
|
+
Write a topic `definition` that describes the topic itself. For example, "Recommendations about which specific stocks to buy" works better than "Do not give investment advice".
|
|
136
|
+
|
|
137
|
+
### Why the version is numbered
|
|
138
|
+
|
|
139
|
+
Each time you change `guardrail.json` and deploy, the infrastructure creates a new numbered guardrail version and writes it to runtime config. The version's description holds the SHA-256 hash of `guardrail.json`, so a change to the file changes the description, and a new version replaces the old one. With the CDK construct, the hash also covers any guardrail properties you pass.
|
|
140
|
+
|
|
141
|
+
Your running agent does not need a restart. It caches what it reads from runtime config for 5 seconds, so it uses the new version within 5 seconds of the AppConfig deployment. The old version is deleted after the AppConfig deployment: CloudFormation deletes it in its cleanup step, and Terraform deletes it after the deployment module when you add the guardrail module to that module's `depends_on`, as shown in [Wiring the guardrail to your agent](#wiring-the-guardrail-to-your-agent).
|
|
142
|
+
|
|
143
|
+
Your agent never uses the `DRAFT` version. `DRAFT` always holds the latest rules, so an edit made in the AWS console would reach your running agent without a deployment. `guardrail.ts` throws an error if the version in runtime config is not a version number.
|
|
144
|
+
|
|
145
|
+
## Wiring the guardrail to your agent
|
|
146
|
+
|
|
147
|
+
The generator does not change your stack or your root Terraform module, in the same way that the `ts#agent` generator leaves deploying the agent to you. When it finishes, it prints the code below with your agent's names filled in. Add it to create the guardrail, write its runtime-config entry and allow the agent to apply the guardrail:
|
|
148
|
+
|
|
149
|
+
<Infrastructure>
|
|
150
|
+
<Fragment slot="cdk">
|
|
151
|
+
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
152
|
+
import { MyAgent, MyAgentGuardrail } from '@my-scope/common-constructs';
|
|
153
|
+
|
|
154
|
+
const agent = new MyAgent(this, 'MyAgent');
|
|
155
|
+
new MyAgentGuardrail(this, 'MyAgentGuardrail', { agent });
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The construct writes the guardrail's ID and version to runtime config at `agentcore.guardrails.MyAgent`, and grants the `agent` permission to apply the guardrail. The agent construct already allows the agent to read runtime config.
|
|
159
|
+
|
|
160
|
+
The construct exposes:
|
|
161
|
+
|
|
162
|
+
- `guardrail` (the `CfnGuardrail`) and `version` (the `CfnGuardrailVersion`)
|
|
163
|
+
- `guardrailId`, `guardrailArn` and `guardrailVersion`
|
|
164
|
+
- `grantApply(grantee)`, which grants `bedrock:ApplyGuardrail` on the guardrail to another principal
|
|
165
|
+
|
|
166
|
+
It also adds the `GuardrailId` and `GuardrailVersion` stack outputs. Its props are `agent` and any `CfnGuardrail` properties. The `CfnGuardrail` properties take precedence over `guardrail.json`. For example, add content filters:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
new MyAgentGuardrail(this, 'MyAgentGuardrail', {
|
|
170
|
+
agent,
|
|
171
|
+
contentPolicyConfig: {
|
|
172
|
+
filtersConfig: [
|
|
173
|
+
{ type: 'HATE', inputStrength: 'HIGH', outputStrength: 'HIGH' },
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
</Fragment>
|
|
179
|
+
<Fragment slot="terraform">
|
|
180
|
+
Add the `my_agent_guardrail` module as shown, in the root module where you deploy your agent. Add its `additional_iam_policy_statements` line to your existing `my_agent` module block. Add `module.my_agent_guardrail` to the `depends_on` list of your `runtime_config_appconfig_deployment` module, so the deployment includes the guardrail's runtime-config entry and Terraform deletes an old guardrail version only after the deployment. If your root module does not deploy the agent yet, add the agent's module first, as described in <Link path="guides/ts-agent#infrastructure-as-code">the TypeScript Agent guide</Link>.
|
|
181
|
+
|
|
182
|
+
```hcl title="packages/infra/src/main.tf"
|
|
183
|
+
module "my_agent_guardrail" {
|
|
184
|
+
source = "../../common/terraform/src/app/guardrails/my-agent"
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
module "my_agent" {
|
|
188
|
+
source = "../../common/terraform/src/app/agents/my-agent"
|
|
189
|
+
# ...existing arguments...
|
|
190
|
+
additional_iam_policy_statements = module.my_agent_guardrail.iam_policy_statements
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
module "runtime_config_appconfig_deployment" {
|
|
194
|
+
# ...existing arguments...
|
|
195
|
+
depends_on = [
|
|
196
|
+
# ...existing modules...
|
|
197
|
+
module.my_agent_guardrail,
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
If your agent module already sets `additional_iam_policy_statements`, combine the lists:
|
|
203
|
+
|
|
204
|
+
```hcl
|
|
205
|
+
additional_iam_policy_statements = concat(module.my_agent_guardrail.iam_policy_statements, local.my_statements)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
The module writes the guardrail's ID and version to runtime config at `agentcore.guardrails.MyAgent`. The `agentcore` namespace is in the default `namespaces` of the runtime-config modules, so you do not need to add it. The agent module already allows the agent to read runtime config.
|
|
209
|
+
|
|
210
|
+
The module takes a `tags` variable and outputs `guardrail_id`, `guardrail_arn`, `guardrail_version` and `iam_policy_statements`. To add other guardrail policies, such as content filters, edit the `aws_bedrock_guardrail` resource in the module.
|
|
211
|
+
|
|
212
|
+
The module sets `create_before_destroy` on the guardrail version, so Terraform creates the new version before it deletes the old one.
|
|
213
|
+
</Fragment>
|
|
214
|
+
</Infrastructure>
|
|
215
|
+
|
|
216
|
+
### A missing runtime-config entry
|
|
217
|
+
|
|
218
|
+
If you forget the wiring, runtime config has no entry for your agent. The model then throws an error before it calls Bedrock, so the agent does not run without its guardrail. For `MyAgent`, the error is:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
No guardrail for this agent in runtime config at agentcore.guardrails.MyAgent. Add the MyAgentGuardrail construct (CDK) or the guardrails/my-agent module (Terraform) to your infrastructure.
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The agent starts with every protocol (`http`, `a2a` and `ag-ui`), and each request fails with this error.
|
|
225
|
+
|
|
226
|
+
## Local development
|
|
227
|
+
|
|
228
|
+
The `<agent>-dev` target sets `LOCAL_DEV=true`. When `LOCAL_DEV` is `true` and the `RUNTIME_CONFIG_APP_ID` environment variable is not set, `guardrail.ts` does not read runtime config. It prints a warning once and the agent runs without a guardrail:
|
|
229
|
+
|
|
230
|
+
<NxCommands commands={['agent-dev your-project']} />
|
|
231
|
+
|
|
232
|
+
To test your rules locally, deploy the guardrail first. Then set `RUNTIME_CONFIG_APP_ID` to the ID of your deployed runtime-config application, from the `RuntimeConfigApplicationId` stack output (CDK) or `module.runtime_config_appconfig.application_id` (Terraform). Your shell also needs AWS credentials that can read AppConfig and apply the guardrail:
|
|
233
|
+
|
|
234
|
+
<NxCommands commands={['agent-dev your-project']} env={{ RUNTIME_CONFIG_APP_ID: '<application-id>' }} />
|
|
235
|
+
|
|
236
|
+
The agent then reads only its own entry, so several guarded agents can run locally against the same application. If the agent cannot read runtime config, or the entry is missing, it prints the warning once and runs without a guardrail.
|
|
237
|
+
|
|
238
|
+
The `<agent>-serve` target does not set `LOCAL_DEV`, so it needs `RUNTIME_CONFIG_APP_ID` and the deployed entry, otherwise each request fails as described above. The `<agent>-chat` target connects to a running agent and needs no runtime config itself.
|
|
239
|
+
|
|
240
|
+
## Cost and latency
|
|
241
|
+
|
|
242
|
+
Amazon Bedrock charges for each guardrail policy that evaluates text, on both the input and the answer. See [Amazon Bedrock pricing](https://aws.amazon.com/bedrock/pricing/).
|
|
243
|
+
|
|
244
|
+
Each model call also takes longer, because the guardrail checks the answer before your agent streams it to the user.
|
|
245
|
+
|
|
246
|
+
## Limitations
|
|
247
|
+
|
|
248
|
+
- This generator supports agents created with `ts#agent`. It does not support the AgentCore Harness.
|
|
249
|
+
- `guardrail.json` holds denied topics and PII entities only. Add other policies, such as content filters and word filters, with the construct's props (CDK) or by editing the module (Terraform).
|
|
250
|
+
- The guardrail does not check tool results, as described in [What the guardrail checks](#what-the-guardrail-checks).
|
package/docs/guides/ts-agent.mdx
CHANGED
|
@@ -552,20 +552,13 @@ Refer to the <Link path="/guides/connection/react-agui">`connection` generator g
|
|
|
552
552
|
|
|
553
553
|
<Snippet name="agent/securing-your-agent" parentHeading="Securing your Agent" />
|
|
554
554
|
|
|
555
|
+
The <Link path="guides/ts-agent-guardrails">`ts#agent#guardrails` generator</Link> does this for you. It adds a `guardrail.json` policy file and the CDK construct or Terraform module that creates the guardrail, and it creates your agent with the guardrailed model:
|
|
556
|
+
|
|
555
557
|
```typescript
|
|
556
558
|
// agent.ts
|
|
557
|
-
import {
|
|
558
|
-
import { BedrockModel } from '@strands-agents/sdk/models/bedrock';
|
|
559
|
-
|
|
560
|
-
const model = new BedrockModel({
|
|
561
|
-
modelId: process.env.MODEL_ID,
|
|
562
|
-
guardrailConfig: {
|
|
563
|
-
guardrailIdentifier: process.env.GUARDRAIL_ID!,
|
|
564
|
-
guardrailVersion: process.env.GUARDRAIL_VERSION ?? 'DRAFT',
|
|
565
|
-
},
|
|
566
|
-
});
|
|
559
|
+
import { getGuardrailedModel } from './guardrail.js';
|
|
567
560
|
|
|
568
|
-
const agent = new Agent({ model, /* ... */ });
|
|
561
|
+
const agent = new Agent({ model: getGuardrailedModel(), /* ... */ });
|
|
569
562
|
```
|
|
570
563
|
|
|
571
564
|
See the Strands [Guardrails](https://strandsagents.com/docs/user-guide/safety-security/guardrails/) guide for more detail.
|
package/generators.json
CHANGED
|
@@ -350,6 +350,14 @@
|
|
|
350
350
|
"metric": "g30",
|
|
351
351
|
"guidePages": ["ts-agent"]
|
|
352
352
|
},
|
|
353
|
+
"ts#agent#guardrails": {
|
|
354
|
+
"factory": "./src/ts/agent/guardrails/generator",
|
|
355
|
+
"schema": "./src/ts/agent/guardrails/schema.json",
|
|
356
|
+
"description": "Add an Amazon Bedrock Guardrail to a TypeScript Agent",
|
|
357
|
+
"metric": "g76",
|
|
358
|
+
"guidePages": ["ts-agent-guardrails"],
|
|
359
|
+
"experimental": true
|
|
360
|
+
},
|
|
353
361
|
"ts#agent#mcp-connection": {
|
|
354
362
|
"factory": "./src/ts/agent/mcp-connection/generator",
|
|
355
363
|
"schema": "./src/ts/agent/mcp-connection/schema.json",
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ts#agent#guardrails",
|
|
4
|
+
"title": "ts#agent#guardrails",
|
|
5
|
+
"x-label": "Agent Guardrails",
|
|
6
|
+
"description": "Add an Amazon Bedrock Guardrail to a TypeScript Agent",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"project": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The project containing the TypeScript Agent",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "argv",
|
|
14
|
+
"index": 0
|
|
15
|
+
},
|
|
16
|
+
"x-prompt": "Select the project containing the TypeScript Agent to guard",
|
|
17
|
+
"x-dropdown": "projects"
|
|
18
|
+
},
|
|
19
|
+
"agent": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "The name of the Agent component to guard. Required when the project contains more than one TypeScript Agent."
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"required": ["project"]
|
|
25
|
+
}
|