Skip to content

feat(audit): name provider, credential, config, and draft policy resources - #5612

Merged
krishicks merged 1 commit into
mainfrom
feat/2911-name-provider-config-resources/krishicks
Nov 19, 2026
Merged

krishicks merged 1 commit into
mainfrom
feat/2911-name-provider-config-resources/krishicks

Conversation

@krishicks

Copy link
Copy Markdown
Collaborator

Summary

Records for provider, credential, configuration, and draft policy changes name nothing, so an auditor cannot tell which provider, credential key, setting, or draft chunk a call changed. They now name those resources and the resulting policy hash. A new opt-in setting records the value a setting was given. Secrets never appear.

Stacked on #5611; review only the last commit until the PRs below it merge.

Related Issue

Part of #2911

Changes

  • Hooks for CreateProvider, UpdateProvider, ConfigureProviderRefresh, RotateProviderCredential, UpdateConfig, and the draft chunk RPCs name the provider, credential key, sandbox, setting key, and chunk IDs. Policy changes, draft approvals, and undo name the resulting policy by its hash as uid.
  • Outcomes: deleting a setting that was not set records no_op:already_absent, clearing no draft chunks records no_op:already_absent, and a bulk approval that approves nothing records no_op:unchanged.
  • [openshell.gateway.audit] capture_setting_values (default false) records the value of a registered setting in the resource's data, only when the value has the setting's type. Bytes values and unregistered keys are never recorded.
  • openshell-ocsf: ResourceDetails gains an optional data field.
  • Credential values, refresh material, review tokens, rejection reasons, and proposed rules never appear; canary tests cover each.
  • When a record exceeds 16 resources, it keeps the last one, which is the result of the change, such as the policy hash after a bulk approval.

Before / after

Real OCSF output from the gateway handlers, called by the test user in workspace default. Each credential and review token below was a canary string that appears in no record.

Call → result Before After
CreateProvider openai with OPENAI_API_KEY → OK Create, Success, no resources Create, Success; workspace:default, provider:openai with its ID
RotateProviderCredential openai/OPENAI_API_KEY, no refresh configured Update, Failure, rejected:not_found, no resources Same outcome; workspace:default, provider:openai, provider_credential:OPENAI_API_KEY
UpdateConfig global ocsf_json_enabled = true Update, Success, no resources Update, Success; setting:ocsf_json_enabled
Same, with capture_setting_values = true Update, Success, no resources Update, Success; setting:ocsf_json_enabled with data: {"value": true}
ApproveDraftChunk chunk-7 on agent-01, absent Update, Failure, rejected:not_found, no resources Same outcome; workspace:default, sandbox:agent-01, draft_chunk:chunk-7

Release Notes

Gateway audit records now name the provider, credential key, setting, and draft chunks a call changed. Set capture_setting_values = true under [openshell.gateway.audit] to also record setting values.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added: provider, refresh, and rotation records name resources but never secrets; setting value capture only for registered, correctly typed values; setting delete no-ops; draft chunk records never include tokens, reasons, or rules; bulk approvals keep the resulting policy; config file parsing
  • E2E tests added/updated (not applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

@copy-pr-bot

copy-pr-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@krishicks
krishicks added this pull request to stack #5610 November 16, 2026 17:31
@github-actions

Copy link
Copy Markdown

@krishicks
krishicks force-pushed the feat/2911-name-provider-config-resources/krishicks branch from f15643e to e82dc72 Compare November 16, 2026 18:51
Base automatically changed from feat/2911-name-created-resources/krishicks to main November 17, 2026 19:32
@krishicks
krishicks force-pushed the feat/2911-name-provider-config-resources/krishicks branch from e82dc72 to 181799f Compare November 18, 2026 21:26
@krishicks
krishicks marked this pull request as ready for review November 18, 2026 21:26
…urces

Records for provider, credential, configuration, and draft policy changes
named nothing, so an auditor could not tell which provider, credential
key, setting, or draft chunk a call changed, and could not see the value
a setting was given.

Name the provider and credential key, the sandbox and setting key, and
the sandbox and draft chunks, plus the resulting policy hash. Add
[openshell.gateway.audit] capture_setting_values to record the value of
a registered setting when it has the registered type. Credential values,
refresh material, review tokens, rejection reasons, and proposed rules
are never recorded, and canary tests cover each. A record over the
resource cap keeps its last resource, the result of the change, and
authorization denials apply the same cap and value bounds.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
@krishicks
krishicks force-pushed the feat/2911-name-provider-config-resources/krishicks branch from 181799f to 064825c Compare November 18, 2026 23:17

@TaylorMutch TaylorMutch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified the denial-path fix in 064825c. Both mutation and authorization-denial events now share the resource-count and field limits. All 27 audit tests passed locally, including an independent handler-level reproduction using a 4,096-byte setting value, which is now bounded to 128 bytes plus the truncation marker.

@krishicks
krishicks added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 5c0d716 Nov 19, 2026
93 of 94 checks passed
@krishicks
krishicks deleted the feat/2911-name-provider-config-resources/krishicks branch November 19, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants