feat(policy): add memory:CreateAgent action - #266
Conversation
Creating an agent record also mints the agent's IAM identity and its derived policy, but memory:PutAgent covered both that and writing a memory beneath a record. A resource pattern cannot keep the two apart, because agents/<id> and agents/<id>/<memory> both match agents/*, so a grant meant to write memories over that pattern also authorized minting credentials. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe policy separates agent creation from memory writes, registers and tests the new action, updates enumeration condition coverage, and bumps three indirect Google dependencies. ChangesMemory action authorization
Indirect dependency updates
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The authorization-action split and dependency updates have no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit splits the actions neat, Comment |
govulncheck reports GO-2026-6348 (HTTP/2 DATA frame OOM) as reachable through certs.NewCertificate2, failing Analysis on every branch once the advisory landed in the live vulnerability database. Fixed in grpc v1.83.1; this takes the current release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
Adds
memory:CreateAgent, so creating an agent record is grantable separatelyfrom writing a memory beneath one.
Why
memory:PutAgentauthorized both operations. In AIStor, creating an agentrecord also mints the agent's IAM user and attaches its derived policy, so the
two operations are not comparable in privilege.
The resource ARN was meant to keep them apart, and cannot. Memory resource
matching is a plain glob where
*crosses/:So the separation survives only the per-agent spelling
agents/<id>/*. Onagents/*— the natural spelling for "may write agent memories in thiscortex" — one action turns a grant to write data into a grant to mint
credentials.
This is the same argument that justified
memory:UpdateAgentin #258, appliedto create, which is the more privileged of the two: an update re-derives a
policy, a create conjures an identity.
Changes
MemoryCreateAgentAction(memory:CreateAgent), added toSupportedMemoryActions.MemoryPutAgentAction's doc now says what it covers: writing a memorybeneath a record, not creating or modifying the record.
createMemoryActionConditionKeyMapderivesfrom
SupportedMemoryActions, and a point action correctly gets the commonkeys with no enumeration keys.
Testing
go build ./...andgo test ./policy/...pass. The new action is added toTestMemoryActionIsValidand to thepointActionslist inTestMemoryEnumerationConditionKeys, which asserts it carries no enumerationcondition keys.
Note for the consumer side
AIStor still authorizes a create under
memory:PutAgent; moving it tomemory:CreateAgentis a follow-up there and needs this released first.Summary by CodeRabbit
New Features
memory:CreateAgentaction for creating agent records and IAM identities.Chores