fix(cli): (1) Author docs/policies.md as a feature guide sourced fr... (#1581)#59
Draft
aidandaly24 wants to merge 1 commit into
Draft
fix(cli): (1) Author docs/policies.md as a feature guide sourced fr... (#1581)#59aidandaly24 wants to merge 1 commit into
aidandaly24 wants to merge 1 commit into
Conversation
…VE enforcement mode (aws#1581) Author docs/policies.md sourced from code (Cedar engines, the four add-policy source methods, the form-based guardrail builder categories, policy effects, enforcement modes ACTIVE|LOG_ONLY, validation modes). Link it from README under the Policies & Guardrails section and the docs index to match the payments/gateway/memory pattern. Correct the vended asset src/assets/agents/AGENTS.md PolicyEnforcementMode from the non-existent PASSIVE to LOG_ONLY and regenerate the assets snapshot. Refs aws#1581
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs aws#1581
Issues
Root cause
Verified by reading docs/policies/ (only IAM jsons), src/cli/tui/screens/policy/types.ts, src/schema/schemas/primitives/policy.ts:53, src/schema/schemas/mcp.ts:1043, README.md:191/211/234, docs/commands.md:645-710, src/assets/agents/AGENTS.md:84, CDKRenderer.ts:54-113, and git log aws#1577. Could not check GitHub for an open PR from this sandbox, but no local branch/ref adds docs/policies.md.
The fix
(1) Author docs/policies.md as a feature guide sourced from code, not the issue body: Cedar policy engines and
add policy-engineflags incl. --attach-to-gateways/--attach-mode LOG_ONLY|ENFORCE (docs/commands.md:645); the fouradd policysource methods from POLICY_SOURCE_METHOD_OPTIONS (form/file/inline/generate, types.ts:238); the form-based guardrail builder's three categories from GUARDRAIL_CATEGORY_OPTIONS (types.ts:58) — contentFilter VIOLENCE|HATE|SEXUAL|MISCONDUCT|INSULTS (spell INSULTS, the aws#1571 regression guard at tests/types.test.ts:15-18), promptAttack JAILBREAK|PROMPT_INJECTION|PROMPT_LEAKAGE, sensitiveInformation (30 entity types types.ts:21-53); policy effects permit/forbid/suppressOutput with INITIATE vs RETURN_OUTPUT phase semantics (types.ts:103-135); enforcement modes ACTIVE|LOG_ONLY (NOT PASSIVE); validation modes FAIL_ON_ANY_FINDINGS|IGNORE_ALL_FINDINGS. (2) AddSee [Policies & Guardrails](docs/policies.md)under README.md:191 and an entry in the README docs index (README.md:307-312) to match the payments/gateway pattern. (3) Resolve the brief's open design question with a definitive YES: fix the shipped PASSIVE defect at src/assets/agents/AGENTS.md:84 to'ACTIVE' | 'LOG_ONLY'and runnpm run test:update-snapshots(updates assets.snapshot.test.ts.snap:7176). This is a real shipped wrong value in a vended asset, not just an issue-body wording slip.Files touched: New file docs/policies.md and README.md:191 + docs index README.md:307-312 (CLI repo /local/home/aidandal/workplace/issues/agentcore-cli). Content sourced from src/cli/tui/screens/policy/types.ts and docs/commands.md:645-710. Plus correct the vended asset src/assets/agents/AGENTS.md:84 (ACTIVE|PASSIVE -> ACTIVE|LOG_ONLY) and regenerate src/assets/tests/snapshots/assets.snapshot.test.ts.snap. No runtime code change required.
Validation evidence
The fix was verified by reproducing the original symptom and re-running after the change:
Test suite: green.
Staged on the fork as a draft for human review. Promote to aws/agentcore-cli after vetting.