Repository navigation
feat(coderd): audit agent definition and plugin pack enablement changes - #381
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6384d9dcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6384d9dcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- record the real enablement transition: delete handlers pass the desired state instead of a hard-coded false to true - omit the content of a personal agent definition from its audit entry, because auditors can read the audit log without access to the personal skill - keep the 403 for a cross-user update: a denied read of the current row falls through to the update, which authorizes the change - name the audit target only after the update succeeds, so a request rejected for an invalid body writes no entry - name the project or chat an enablement changed in the entry
Addressed the first Codex review in 323dd04:
All seven threads are resolved. Re-review requested below. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 323dd0407f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- the audit view of a project agent definition omits the content, because auditors can read the audit log without access to a chat project - the audit view of a personal agent definition names its owner, so a deleted personal definition stays traceable - an update that a read-denied but write-allowed token performs still records the fields it requested
Addressed the second Codex review in 3ef660c:
All three threads are resolved. Re-review requested below. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ef660c694
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- a project definition audit entry names its project, so a deleted definition stays traceable to it - an enablement entry records its transition only after the write succeeded, so a failed write claims no state change - an update-only scoped token that changes the prompt records a secret content change instead of a description change - the personal definition audit test re-reads the entries after the failed requests, so a failed request that wrote an entry fails
Addressed the third Codex review in 0d15432:
All four threads are resolved. Re-review requested below. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d15432c44
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- a project or personal definition update that changes the prompt body records a secret content change, so the entry is not empty - a project definition update by a token that may write but not read no longer fails on the audit read, and records the fields it requested like the personal tier does
Addressed the fourth Codex review in 20e42da:
All three threads are resolved. Re-review requested below. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merged origin/main (da6d496, #379) into the branch. No conflicts. The audit tests pass on the merge commit. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merged origin/main (25df403, #380) into the branch. No conflicts. The audit tests pass on the merge commit. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe05ce6249
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The target and the transition are recorded only after the write succeeded, so a failed write leaves no audit entry at all.
Addressed the Codex finding on the merge commit in 2c338f0: the enablement audit target and transition are recorded only after the write succeeded, so a failed write leaves no entry at all. Thread resolved. Re-review requested below. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c338f0a7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
An update-only scoped token that sends new front matter records the description it wrote in the audit entry, in both the personal and the project tier.
Addressed the Codex finding in 82b9b7b: an update-only scoped token that sends new front matter records the description it wrote, in both the personal and the project tier. Thread resolved. Re-review requested below. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merged at head Gates on this exact head:
Tests I ran on
Review notes:
Not exercised:
|
Closes #355.
What changed
The fork mutations from #218's follow-up list now write one audit entry on success, using the same
coderd/fork_audit.gohelper as the #218 call sites (initForkAudit,target,diff). Each entry is a write of the owning organization withfork_resource,operationandchangesin the additional fields:coderd/fork_project_agent_definitions.goaudit asproject_agent_definition.coderd/fork_agent_definitions.goaudit asuser_agent_definition.coderd/fork_plugin_pack_enablement.goaudit asproject_plugin_pack,chat_plugin_packorchat_excluded_plugin_pack.Nothing is written for a request denied before authorization:
initForkAuditstarts the entry before the handler authorizes, and the commit only runs when the organization target has been named, which happens on success, like the upstream handlers and the #218 call sites. A request that fails after authorization also writes no entry becausetargetis only called on success.Redaction
The #218 helper keeps full field values in
changesand only the pack sources handler treats its URL host specially. I followed that: agent definition content and descriptions are recorded in full (they are the point of the audit trail and the operator can already read them through the API), and there are no secrets in these resources. The plugin pack source URL is not part of these entries; enablement entries record only the pack ID, name and the changed enablement state.Test plan
audit.NewMock()tests:TestForkProjectAgentDefinitionsAudit,TestForkUserAgentDefinitionsAudit,TestForkPluginPackEnablementAudit, following the existingTestForkOrganizationAgentDefinitionsAuditpattern. They assert one entry per mutation, the resource type, operation, resource ID and name, the changed fields, and that denied and failed requests write nothing.TestForkPluginPackEnablementAuditfail with 0 entries instead of 2, then the call was restored and the test passed.go build ./...,make lint(no new findings versus base on the touched files) and the coderd test package were run locally;make genis not needed because no queries or migrations changed.