Skip to content

feat(gateway-target): add --include-domains for the web-search connector - #2269

Open
sundargthb wants to merge 1 commit into
aws:mainfrom
sundargthb:feat/web-search-include-domains
Open

feat(gateway-target): add --include-domains for the web-search connector#2269
sundargthb wants to merge 1 commit into
aws:mainfrom
sundargthb:feat/web-search-include-domains

Conversation

@sundargthb

Copy link
Copy Markdown
Member

What

add gateway-target accepts --include-domains for the web-search connector, alongside the --exclude-domains it already had. The interactive wizard gains a matching Include Domains step, and the translator now emits both lists inside one domainFilter.

agentcore add gateway-target --type connector --connector web-search \
  --name ws --gateway main-gw \
  --include-domains docs.aws.amazon.com,aws.amazon.com \
  --exclude-domains internal.example.com
{ "name": "WebSearch", "parameterValues": { "domainFilter": {
  "include": ["docs.aws.amazon.com", "aws.amazon.com"],
  "exclude": ["internal.example.com"]
} } }

Why

The connector's admin-level domainFilter takes include and exclude, and the tool schema documents both. Both AgentCore SDKs expose both, per-request, and so does the tool itself. The CLI could only ever set exclude, so a target restricted to an approved set of domains was not expressible through the CLI at all, and the common case of pointing a search target at a documentation set had to be done by editing the project file by hand.

Behaviour worth knowing

An empty list is omitted rather than sent. An empty include is not the same request as an absent one: sending it would tell the connector to return nothing. Passing --include-domains "" therefore leaves the filter unset rather than producing a target that matches no domains.

--include-domains may be given once, with a comma-separated value, matching how --exclude-domains already behaves and reusing the same coercer. It is rejected on any target that is not --connector web-search, which is the existing gate generalised to cover both flags.

Tests

translators.ts had no test file, so this adds one covering include only, exclude only, both together, an empty list, and one list empty while the other is set. Two cases were added to GatewayTargetPrimitive.test.ts for the include path and for both lists reaching one domainFilter.

The unit suite is unchanged apart from those additions: 30 tests fail on main in this repo before this change and the same 30 fail after it, with 8 added tests passing. AddGatewayJwtConfig.test.tsx > confirm screen shows Allowed Audience value failed on one run and passed both in isolation and on a rerun, so that one is load-sensitive rather than related. Typecheck, eslint and prettier are clean.

The web search connector's admin-level domainFilter accepts include and
exclude, and both AgentCore SDKs expose both. The CLI could only set exclude,
so a target restricted to an allowed set of domains was not expressible.

Adds --include-domains alongside --exclude-domains on add gateway-target, an
Include Domains step in the interactive wizard, and both lists in one
domainFilter in the translator. An empty list is omitted rather than sent,
since an empty include list would tell the connector to return nothing.

The translator had no test file, so this adds one covering include only,
exclude only, both together, and the empty cases.
@sundargthb
sundargthb requested a review from a team September 10, 2026 15:03
@github-actions github-actions Bot added the size/m PR size: M label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.28.1.tgz

How to install

gh release download pr-2269-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.28.1.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant