Skip to content

docs(vault): document allowedAgents enforcement, and correct the javadoc that denies it - #667

Merged
ginccc merged 3 commits into
mainfrom
docs/vault-grant-enforcement
Aug 11, 2026
Merged

docs(vault): document allowedAgents enforcement, and correct the javadoc that denies it#667
ginccc merged 3 commits into
mainfrom
docs/vault-grant-enforcement

Conversation

@ginccc

@ginccc ginccc commented Aug 11, 2026

Copy link
Copy Markdown
Member

allowedAgents became enforced in #662 and enforcement became the default in #664, but docs/secrets-vault.md never mentioned eddi.vault.grant-enforcement at all. The only description of the feature lived in docs/changelog.md, which operators don't read.

The doc section

New Agent Grants section in docs/secrets-vault.md, between Secret References and Encryption:

  • Why the check is at deploy time rather than resolution time, and why the gate sits in AgentFactory.deployAgent — the one boundary every deployment path funnels through
  • The three modes, and the two parsing rules: an unrecognized value fails startup, and absent/blank resolves to enforce rather than something weaker
  • What counts as granted — including that null/empty means unrestricted, not "deny all", and that uncertainty (unreadable metadata, disabled vault, missing secret) never becomes a violation
  • Which configurations are scanned
  • The upgrade step, with the exact log string to grep for

The javadoc was worse than missing — it was wrong

Four places still told the reader the field is not enforced:

File Said Reality
SecretMetadata "visibility only — enforcement is via configuration authorship, not runtime resolution" Flatly wrong since #662
VaultSecretProvider "stored for visibility/documentation but NOT enforced at resolution time" True of that class, reads as "not enforced anywhere"
EncryptedSecret "for visibility/documentation only" (twice) Same
AgentSetupService "Narrowing this list would imply an enforcement that does not exist" The enforcement now exists

This is the same text that, earlier in this review, caused a proposed narrowing of allowedAgents to be reverted as security theater. It was accurate when written and became false when the behavior changed under it — left alone, it now misleads in the opposite direction.

AgentSetupService still writes ["*"]

Still correct, but for a different reason than the old comment gave. The wizard vaults the key before the agent exists — vaultApiKey is called at line 165, agentId is only extracted at line 209, and the method only ever receives agentName. Narrowing at that call site would mean guessing an unassigned ID, and guessing wrong blocks the very agent the key was vaulted for. The comment now says that, instead of citing an enforcement gap that has since closed.

Verification

  • Clean compile
  • Zero non-comment lines changed in the Java diff — provably documentation-only
  • 70 vault tests pass (VaultGrantGateModeTest, VaultGrantCheckerTest, VaultSecretProviderTest, VaultSecretProviderBranchTest), counts read from the Surefire XML; the .txt summary reports Tests run: 0 for @Nested classes
  • No new tests: no behavior changed

Operator note

This documents, but does not change, the behavior shipped in #664. The deployments actually affected by enforcement have both a vault master key and a deliberately narrowed grant; everywhere else the control is inert (no master key short-circuits the checker, and auto-vaulted keys carry ["*"]).

Summary by CodeRabbit

  • Documentation
    • Added guidance on per-secret agent access controls, including enforcement modes, parsing rules, wildcard access, and unrestricted configurations.
    • Documented scanned configuration sources and migration guidance for enabling enforcement.
    • Clarified that access checks occur during agent deployment rather than secret retrieval.
    • Updated API-key setup guidance, including default wildcard access and instructions for narrowing permissions afterward.
    • Corrected outdated technical documentation and changelog details.

…doc that denies it

allowedAgents became enforced (#662) and enforcement became the default
(#664), but docs/secrets-vault.md never mentioned
eddi.vault.grant-enforcement at all. The only description of the feature
lived in the changelog, which operators do not read.

Adds an "Agent Grants" section: the three modes, the two parsing rules
(an unknown value fails startup, absent/blank resolves to enforce), what
counts as granted, which configurations are scanned, and the upgrade step
for the one deployment shape that is actually affected -- a master key
plus a deliberately narrowed grant, where the first symptom is an agent
refusing to deploy with no warning phase.

The javadoc was worse than missing. Four places still told the reader the
field is not enforced: SecretMetadata (flatly wrong), VaultSecretProvider
and EncryptedSecret (true of those classes, but reading as "not enforced
anywhere"), and the AgentSetupService comment arguing for "*" on the
grounds that the enforcement does not exist.

AgentSetupService still writes ["*"], which is still correct, but for a
different reason than the old comment gave: the wizard vaults the key
before the agent exists (vaultApiKey at line 165, agentId extracted at
209) and only ever receives agentName, so narrowing there would mean
guessing an unassigned ID and blocking the agent the key was vaulted for.

Documentation only -- no executable line changed.
@ginccc
ginccc requested a review from rolandpickl as a code owner August 11, 2026 12:08
@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@ginccc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e0c5e2d-fbcd-4075-a776-5bdaede5169c

📥 Commits

Reviewing files that changed from the base of the PR and between 9f3d5df and 8cf5d13.

📒 Files selected for processing (9)
  • docs/changelog.md
  • docs/secrets-vault.md
  • src/main/java/ai/labs/eddi/secrets/ISecretProvider.java
  • src/main/java/ai/labs/eddi/secrets/SecretResolver.java
  • src/main/java/ai/labs/eddi/secrets/impl/VaultSecretProvider.java
  • src/main/java/ai/labs/eddi/secrets/model/EncryptedSecret.java
  • src/main/java/ai/labs/eddi/secrets/model/SecretMetadata.java
  • src/main/java/ai/labs/eddi/secrets/model/SecretReference.java
  • src/main/java/ai/labs/eddi/secrets/rest/IRestSecretStore.java
📝 Walkthrough

Walkthrough

This documentation-only change defines allowedAgents enforcement during agent deployment. It documents enforcement modes, parsing, grant rules, fail-open conditions, scanned configurations, wildcard setup grants, and migration guidance. JavaDocs now align with VaultGrantGate behavior.

Changes

allowedAgents documentation

Layer / File(s) Summary
Enforcement contract
src/main/java/ai/labs/eddi/secrets/model/*, src/main/java/ai/labs/eddi/secrets/impl/VaultSecretProvider.java
JavaDocs describe deployment-time enforcement, unrestricted null or empty grants, and the boundary between secret resolution and deployment validation.
Configuration and migration guidance
docs/secrets-vault.md, src/main/java/ai/labs/eddi/engine/setup/AgentSetupService.java, docs/changelog.md
Documentation defines enforcement modes, parsing rules, scanned configurations, fail-open conditions, wildcard setup grants, and upgrade steps.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • labsai/EDDI#418: Both changes cover docs/secrets-vault.md and AgentSetupService API-key vaulting.
  • labsai/EDDI#659: Implements the allowedAgents deployment-time enforcement documented here.
  • labsai/EDDI#664: Changes the default enforcement mode documented here.

Suggested reviewers: rolandpickl

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the documentation and Javadoc corrections for existing allowedAgents enforcement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/vault-grant-enforcement

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The "Additional vault settings in application.properties" block listed
cache-ttl-minutes and cache-max-size but not grant-enforcement, so an
operator scanning it for the available knobs would not have found the one
that decides whether a misconfigured agent deploys.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/java/ai/labs/eddi/secrets/model/SecretMetadata.java`:
- Around line 16-20: Update the Javadoc near SecretMetadata to qualify that an
allowed-agent violation stops deployment only when VaultGrantGate.Mode.ENFORCE
is active; note that WARN permits deployment after logging and OFF skips
enforcement.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd10a643-704e-4e85-8754-7b4f28c27a94

📥 Commits

Reviewing files that changed from the base of the PR and between 8dda2da and 48fa82b.

📒 Files selected for processing (6)
  • docs/changelog.md
  • docs/secrets-vault.md
  • src/main/java/ai/labs/eddi/engine/setup/AgentSetupService.java
  • src/main/java/ai/labs/eddi/secrets/impl/VaultSecretProvider.java
  • src/main/java/ai/labs/eddi/secrets/model/EncryptedSecret.java
  • src/main/java/ai/labs/eddi/secrets/model/SecretMetadata.java

Comment thread src/main/java/ai/labs/eddi/secrets/model/SecretMetadata.java Outdated
…inish the sweep

Review feedback on #667: the javadoc said a violation stops the agent
coming up, which is true only under enforce. warn logs and allows, off
does not check at all. Every place asserting the blocking behavior now
names eddi.vault.grant-enforcement as what decides it -- SecretMetadata
(the flagged one), plus EncryptedSecret and VaultSecretProvider, which
carried the same unqualified claim and were not flagged.

The doc's own lead paragraph had the same problem and now points at the
modes table instead of asserting the agent "simply does not come up".

Grepping the phrase rather than fixing one file per review comment turned
up four more files still describing the old access model as current:
ISecretProvider, SecretReference, IRestSecretStore and SecretResolver all
said "access control is via configuration authorship". SecretResolver's
second sentence -- that the resolver itself does not check permissions --
was accurate and is kept; only the stale lead-in changed.

VaultGrantChecker and its test quote the old wording deliberately ("was
documented as...") and keep it. That is history, not a stale claim.

Documentation only -- no executable line changed. compile, validate and
80 vault tests green.
@ginccc
ginccc requested a review from aisabella-ai August 11, 2026 14:40
@ginccc
ginccc merged commit 6f79b28 into main Aug 11, 2026
26 checks passed
@ginccc
ginccc deleted the docs/vault-grant-enforcement branch August 11, 2026 14:41
ginccc added a commit that referenced this pull request Aug 11, 2026
main moved again before this branch was pushed (#664, #665, #667, #668).

Conflicts, both in docs:

- docs/changelog.md — both sides prepended entries again; kept both, nothing
  dropped.
- docs/secrets-vault.md — #667 documented vault agent grants independently,
  and #664 changed the default to enforce, which made this branch's
  "warn (default)" row wrong. Resolved in main's favour: main's section is
  kept whole and this branch's duplicate dropped, rather than interleaved.

Follow-on fixes: the group docs' cross-reference now points at main's anchor
and says the thing main's section does not — that a sub-agent inheriting a
parent's vault reference must itself be granted the secret, or under the new
default it will not deploy.

Re-verified after the merge: the "80+ MCP tools" claim in README/docs/AGENTS
still holds (84 @tool methods, matching McpToolFilter's whitelist exactly).
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