Skip to content

chore(policy): ungate guardrail policy form#1552

Merged
notgitika merged 2 commits into
mainfrom
chore/ungate-guardrail-policy-form
Jun 17, 2026
Merged

chore(policy): ungate guardrail policy form#1552
notgitika merged 2 commits into
mainfrom
chore/ungate-guardrail-policy-form

Conversation

@jesseturner21

Copy link
Copy Markdown
Contributor

Summary

Removes the ENABLE_GATED_FEATURES gate on the guardrail policy form so it's generally available.

Previously gated behind isGatedFeaturesEnabled():

  • CLI options (agentcore add policy): --target, --form-category, --form-filters, --form-effect, --form-data-path — hidden from --help when the flag was off
  • Runtime guard: --form-category threw Guardrail policy form is not yet available.
  • Interactive TUI: the form source method was disabled with a "Coming soon" label

Changes

  • PolicyPrimitive.ts: drop the gate() helper and the runtime not yet available guard; the form options are now plain .option() calls. Removed now-unused isGatedFeaturesEnabled and Option imports.
  • AddPolicyScreen.tsx: the form option is no longer disabled/gated. Removed now-unused isGatedFeaturesEnabled import.

Scope is limited to the guardrail form path — the isGatedFeaturesEnabled flag itself and its other call sites (harness, knowledge-base, gateway-target, config-bundle, etc.) are untouched.

Testing

  • npm run typecheck passes.
  • Pre-commit hooks (eslint, prettier, secretlint) pass.

The guardrail form path (--target, --form-category, --form-filters,
--form-effect, --form-data-path CLI options and the interactive "form" source
method) was hidden behind ENABLE_GATED_FEATURES. Remove that gating so the
feature is generally available: options show in --help, the runtime
"not yet available" guard is dropped, and the interactive option is no longer
disabled with "Coming soon". Drops the now-unused isGatedFeaturesEnabled and
Option imports.

Confidence: high
Scope-risk: narrow
@jesseturner21 jesseturner21 requested a review from a team June 17, 2026 18:05
@github-actions github-actions Bot added the size/s PR size: S label Jun 17, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 17, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.19.0.tgz

How to install

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

@agentcore-cli-automation agentcore-cli-automation left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff against origin/main. The change is small and surgical: it removes the gate() helper and the runtime formCategory guard in PolicyPrimitive.ts, and drops the gated/"Coming soon" branch in AddPolicyScreen.tsx. The form-path code itself (synth, validation, mutual-exclusion check, telemetry policy_attr_source_type: 'form') was already in place behind the flag and is unchanged.

No functional issues found:

  • Other call sites of isGatedFeaturesEnabled (harness, knowledge-base, gateway-target, config-bundle, etc.) are correctly left untouched.
  • Telemetry coverage for the form path already exists (no new instrumentation needed).
  • No test changes required — the existing tests don't reference the removed gating, and synthesize-cedar.test.ts already covers the synthesis logic.
  • No leftover "Coming soon" / "not yet available" references for the policy form path.

LGTM 🚀

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 36.77% 13433 / 36529
🔵 Statements 36.06% 14285 / 39604
🔵 Functions 31.19% 2284 / 7321
🔵 Branches 30.53% 8864 / 29026
Generated in workflow #3674 for commit c2d64b8 by the Vitest Coverage Report Action

notgitika
notgitika previously approved these changes Jun 17, 2026
The dev-server integ test only recorded projectPath when create exited 0
and silently left it undefined otherwise. A transient create failure in CI
then surfaced as the unhelpful "expected undefined to be truthy" in every
test, hiding the real cause. Throw with the captured stderr/stdout instead,
matching the createTestProject factory's behavior, so a genuine failure is
actionable and a flaky one is visible.

Constraint: dev-server suite needs a real installed project (skipInstall: false), so it cannot use the factory's fast default
Confidence: high
Scope-risk: narrow
Not-tested: the specific transient create failure seen in CI (not reproducible locally)
@github-actions github-actions Bot removed the size/s PR size: S label Jun 17, 2026
@github-actions github-actions Bot added the size/s PR size: S label Jun 17, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
projectPath = json.projectPath;
if (result.exitCode !== 0) {
throw new Error(`Project creation failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Is this change intentionally included?

The refactor makes sense to throw early, but seems unrelated?

@Hweinstock

Copy link
Copy Markdown
Contributor

LGTM once CI passes.

@notgitika notgitika merged commit d5745af into main Jun 17, 2026
38 of 41 checks passed
@notgitika notgitika deleted the chore/ungate-guardrail-policy-form branch June 17, 2026 19:10
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: the review did not analyze this PR (model took 0 turns). See the run for details; a later push or re-run is needed.

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants