Skip to content

EAI-2440: Check stream processor databases against databaseNames - #181

Merged
mongodben merged 4 commits into
mainfrom
cursor/database-allowlist-streams-81d8
Oct 23, 2026
Merged

mongodben merged 4 commits into
mainfrom
cursor/database-allowlist-streams-81d8

Conversation

@mongodben

Copy link
Copy Markdown
Collaborator

Jira: https://jira.mongodb.org/browse/EAI-2440

Why this change

  • With writes enabled, mongodb__atlas_streams_build and
    mongodb__atlas_streams_manage can create or modify Atlas Stream Processing
    processors that read from or write to cluster databases ($source,
    $lookup, $merge, $out, and dlq).
  • EAI-2440: Limit agents to allowed databases with databaseNames #177 skips those tools in databaseAllowlistMiddleware.

Changes

  • Check stream processor databases against databaseNames on
    mongodb__atlas_streams_build and mongodb__atlas_streams_manage:
    • dlq.db
    • $source.db when a collection change stream source is configured
    • $lookup.from.db
    • $merge.into.db (or $merge.db)
    • $out.db
  • Reject stream processor stages and dlq configs whose database cannot be
    read as a non-empty string
  • Document what is checked and what cannot be checked (start-processor on an
    existing processor, and cluster-wide $source stages that omit db) in the
    Atlas Explorer README and config.ts

Notes

Open in Web Open in Cursor 

@cursor
cursor Bot force-pushed the cursor/database-allowlist-streams-81d8 branch 3 times, most recently from 3cd2e6b to fbb3540 Compare October 23, 2026 16:14
@cursor
cursor Bot force-pushed the cursor/database-allowlist-perf-advisor-81d8 branch from 0caf67b to 538d531 Compare October 23, 2026 16:22
@cursor
cursor Bot force-pushed the cursor/database-allowlist-streams-81d8 branch from 0d3750d to 69f5356 Compare October 23, 2026 16:23
Base automatically changed from cursor/database-allowlist-perf-advisor-81d8 to main October 23, 2026 16:29
@mongodben
mongodben requested a balanced review from Copilot October 23, 2026 16:29
@cursor
cursor Bot force-pushed the cursor/database-allowlist-streams-81d8 branch from 69f5356 to 1530e0b Compare October 23, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The recursive stream walker treats literal payloads as executable stages and rejects valid processors.

1 open issue
What changed in this PR

Extends the shared databaseNames guardrail to Atlas Stream Processing,
building on the earlier database and Performance Advisor checks.

Changes:

  • Checks databases named in processor pipelines and dead-letter queues.
  • Adds tests for allowed, disallowed, and malformed database arguments.
  • Documents coverage and limitations in agent configuration comments and READMEs.
File Description
packages/​agent-engine-core/​src/​databaseAllowlist.ts Adds stream processor and Performance Advisor database checks.
packages/​agent-engine-core/​src/​databaseAllowlist.test.ts Tests database validation for both tool groups.
agents/​atlas-query-insights/​src/​agent_atlas_query_insights/​config.ts Documents Performance Advisor coverage in comments.
agents/​atlas-query-insights/​README.md Describes namespace validation.
agents/​atlas-explorer/​src/​agent_atlas_explorer/​config.ts Documents stream validation and limitations in comments.
agents/​atlas-explorer/​README.md Explains expanded guardrails and unchecked operations.

Review effort: Balanced

Comment thread packages/agent-engine-core/src/databaseAllowlist.ts Outdated
The coverage comment listed several checks in one sentence, and the
Atlas tool comment joined Performance Advisor with stream processors.
Each check is now its own point so a reader can scan them.
The matcher checked length, then tested any shorter string against the
patterns. Each check is now named, and a name containing $ or another
forbidden character fails before a loose pattern can match it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The checks match the documented scope, include regression coverage, and have no identified blocking issues.

No open issues 🎉

Review effort: Balanced

@mongodben
mongodben marked this pull request as ready for review October 23, 2026 18:08
@mongodben
mongodben merged commit 6622f55 into main Oct 23, 2026
14 checks passed
@mongodben
mongodben deleted the cursor/database-allowlist-streams-81d8 branch October 23, 2026 18:08
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.

3 participants