Skip to content

fix(studio): reduce scope of sample agent - #1135

Merged
nv-odrulea merged 2 commits into
mainfrom
od/trim-example-agent
Aug 7, 2026
Merged

fix(studio): reduce scope of sample agent#1135
nv-odrulea merged 2 commits into
mainfrom
od/trim-example-agent

Conversation

@nv-odrulea

@nv-odrulea nv-odrulea commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

email-security-analyst is Studio's showcase sample agent. It currently ships 11 tools and a 22-task eval suite.

For a "hello world" demo that is too much surface. A newcomer opening register.py sees 346 lines and 11 near-identical registrars; a newcomer opening eval-config.task-driven.json sees 1619 lines. The diversity that matters for the demo is metric diversity, not tool count, and all four metric flavors survive a much smaller tool set.

Outcome: 4 tools, 10 tasks, 5 views. Pure deletion. Every surviving task and metric block copies over byte-for-byte. Nothing is authored from scratch. The dataset-driven eval path is untouched.

Related Issue

https://linear.app/nvidia/issue/ASTD-319

Summary by CodeRabbit

  • New Features

    • Streamlined the email security analyst to support message review, message triage, thread tracing, and warning drafting.
    • Updated the sample agent to support reviewing one or multiple selected messages.
  • Changes

    • Removed batch analysis, severity assessment, attack attribution, header analysis, URL-brand checking, incident response, and IOC extraction capabilities.
  • Documentation

    • Updated the sample agent description, capability listings, evaluation tasks, and scoring guidance to reflect the streamlined workflow.

Signed-off-by: Octavian Drulea <odrulea@nvidia.com>
@nv-odrulea
nv-odrulea requested review from a team as code owners August 6, 2026 19:12
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The email security analyst sample now exposes four capabilities: review_messages, triage_message, trace_thread, and draft_warning. Obsolete analysis functions, IOC extraction, related prompts, utilities, tests, and evaluation tasks were removed.

Changes

Email security analyst capability reduction

Layer / File(s) Summary
Reduce runtime capabilities
plugins/nemo-agents/examples/email-security-analyst/...
The runtime registration, prompts, workflow declarations, and project description retain four capabilities. Obsolete analysis functions and deterministic IOC extraction were removed.
Align sample agent metadata
web/packages/studio/public/sample-agents/email-security-analyst/agent.yml, web/packages/studio/src/constants/sampleAgents.ts
The Studio sample configuration and NAT mappings now define the same four capabilities and support one or several messages.
Update evaluation tasks
web/packages/studio/public/sample-agents/email-security-analyst/eval-config.task-driven.*
The evaluation scope now contains 10 tasks across five families. Two ordered-thread tasks score the expected phishing message index.

Possibly related PRs

Suggested labels: refactor

Suggested reviewers: sandychapman, steramae-nvidia, arpitsardhana

🚥 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 and concisely describes the primary change: reducing the scope of the Studio sample agent.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch od/trim-example-agent

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

@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
`@web/packages/studio/public/sample-agents/email-security-analyst/eval-config.task-driven.README.md`:
- Around line 34-35: Update the metric-coverage statement near “Two per family”
to say that every metric flavor is represented across the suite, replacing the
inaccurate “represented once” wording while preserving the listed metric
flavors.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 359f2b46-8d08-465a-b73c-49b051347cd5

📥 Commits

Reviewing files that changed from the base of the PR and between c71ca67 and 842912a.

📒 Files selected for processing (10)
  • plugins/nemo-agents/examples/email-security-analyst/pyproject.toml
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/email-security-analyst-agent.yml
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/prompt.py
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/register.py
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/utils.py
  • plugins/nemo-agents/examples/email-security-analyst/tests/test_extract_iocs.py
  • web/packages/studio/public/sample-agents/email-security-analyst/agent.yml
  • web/packages/studio/public/sample-agents/email-security-analyst/eval-config.task-driven.README.md
  • web/packages/studio/public/sample-agents/email-security-analyst/eval-config.task-driven.json
  • web/packages/studio/src/constants/sampleAgents.ts
💤 Files with no reviewable changes (5)
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/prompt.py
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/utils.py
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/register.py
  • plugins/nemo-agents/examples/email-security-analyst/tests/test_extract_iocs.py
  • plugins/nemo-agents/examples/email-security-analyst/src/nat_email_security_analyst/email-security-analyst-agent.yml

@nv-odrulea
nv-odrulea enabled auto-merge August 6, 2026 19:40
@nv-odrulea
nv-odrulea disabled auto-merge August 6, 2026 21:55
@nv-odrulea
nv-odrulea enabled auto-merge August 6, 2026 22:03
@github-actions github-actions Bot added the fix label Aug 7, 2026
@nv-odrulea
nv-odrulea added this pull request to the merge queue Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 31439/40061 78.5% 63.0%
Integration Tests 18304/38013 48.1% 20.8%

Merged via the queue into main with commit 20e39e0 Aug 7, 2026
52 checks passed
@nv-odrulea
nv-odrulea deleted the od/trim-example-agent branch August 7, 2026 05:10
walston added a commit that referenced this pull request Aug 11, 2026
…mple

The orchestrator now fans out to specialist subagents before the verdict, so the
analysis is a traced, tunable chain instead of one opaque classification:

- url-brand-analyst   - lookalike / brand-impersonation judgement on the domains
                        extract_iocs harvested (tool -> subagent composition)
- attack-attributor   - names the attack category (bec/credential/malware/spam/benign)
- header-auth-analyst - SPF/DKIM/DMARC reading, gated on the email actually
                        carrying Authentication-Results:/Received: headers

phishing-analyzer stays the verdict owner and folds the findings in, adding
`attack_type` and `impersonated_brand` to the YAML verdict.

Prompts are ported from the email-security-analyst NAT example (they were removed
from it in #1135 as more protocol than that sample needed). There they were LLM
capability tools behind a router; here each is a declarative subagent, so its
reasoning gets its own trace span and its prompt is tunable in agent.yaml. The
prompt-injection guardrails are ported with them.

analyze_headers is demo-only: the scored dataset has no SMTP headers, and
synthesizing them per row would leak the phishing/benign label into the input and
inflate the eval. README shows a header-bearing email to exercise it by hand.

Verified live (--mode subprocess, real NVIDIA_API_KEY): 3/3 invocations return the
correct schema - phishing (plain + header-bearing) true, benign false - with
attack_type and impersonated_brand populated. The runtime checkpointer shows all
four subagent tasks plus the extract_iocs tool call. AgentConfig validate +
Fabric translate OK; ruff clean; 8/8 tool tests.

Co-authored-by: Octavian Drulea <odrulea@nvidia.com>
Signed-off-by: Nathan Walston <nwalston@nvidia.com>
ryana pushed a commit to ryana/nemo-platform that referenced this pull request Aug 12, 2026
…y Triage (NVIDIA-NeMo#1222)

* feat(nemo-agents): add specialist subagents to the email-phishing example

The orchestrator now fans out to specialist subagents before the verdict, so the
analysis is a traced, tunable chain instead of one opaque classification:

- url-brand-analyst   - lookalike / brand-impersonation judgement on the domains
                        extract_iocs harvested (tool -> subagent composition)
- attack-attributor   - names the attack category (bec/credential/malware/spam/benign)
- header-auth-analyst - SPF/DKIM/DMARC reading, gated on the email actually
                        carrying Authentication-Results:/Received: headers

phishing-analyzer stays the verdict owner and folds the findings in, adding
`attack_type` and `impersonated_brand` to the YAML verdict.

Prompts are ported from the email-security-analyst NAT example (they were removed
from it in NVIDIA-NeMo#1135 as more protocol than that sample needed). There they were LLM
capability tools behind a router; here each is a declarative subagent, so its
reasoning gets its own trace span and its prompt is tunable in agent.yaml. The
prompt-injection guardrails are ported with them.

analyze_headers is demo-only: the scored dataset has no SMTP headers, and
synthesizing them per row would leak the phishing/benign label into the input and
inflate the eval. README shows a header-bearing email to exercise it by hand.

Verified live (--mode subprocess, real NVIDIA_API_KEY): 3/3 invocations return the
correct schema - phishing (plain + header-bearing) true, benign false - with
attack_type and impersonated_brand populated. The runtime checkpointer shows all
four subagent tasks plus the extract_iocs tool call. AgentConfig validate +
Fabric translate OK; ruff clean; 8/8 tool tests.

Co-authored-by: Octavian Drulea <odrulea@nvidia.com>
Signed-off-by: Nathan Walston <nwalston@nvidia.com>

* docs(nemo-agents): address CodeRabbit review on the specialist example

- agent.yaml: require lowercase impersonated_brand in the phishing-analyzer
  verdict schema too (the orchestrator copy was already lowercase; the sub-agent
  copy wasn't - that mismatch is why live output flip-flopped PayPal vs paypal).
- README Step 2: phishing-analyzer owns the verdict and emits every field; the
  attack_type/impersonated_brand values are specialist-informed (advisory), not
  produced by the specialists instead of the classifier.
- README Step 3: fix a self-contradictory synthetic header example - it had
  spf=fail but dkim=pass/dmarc=pass, which actually authenticates From: paypal.com.
  Make all three fail and lead the explanation with dmarc=fail on header.from,
  the check tied to the visible From: domain.
- README Step 4: traces carry a task per *applicable* specialist; header-auth-analyst
  appears only for header-bearing input (the Step 2 email has none).

Co-authored-by: Octavian Drulea <odrulea@nvidia.com>
Signed-off-by: Nathan Walston <nwalston@nvidia.com>

* refactor(nemo-agents): rename example email-phishing-agent -> email-security-triage

With the specialist sub-agents this example is broader than "phishing" — it's an
email-security triage orchestrator — so rename it to match (display name
"Email Security Triage", slug `email-security-triage`). Folded into this PR because
the specialists are the reason for the rename.

Full identifier sweep (collision-checked vs the still-present NAT
`email-security-analyst` and `email-phishing-analyzer`):
- example dir, agent `name`, telemetry project
- package `nemo-agent-config-example-email-phishing` -> `...-email-security-triage`
- console script / MCP url `email-phishing-iocs` -> `email-security-triage-iocs`
  (MCP server key stays `iocs`; module stays `mcps/iocs.py`)
- eval config `email-phishing-eval.yml` -> `email-security-triage-eval.yml`
- default deployment name in the README
- Studio registry key/namePrefix/displayName/agentConfigPath + sample dir
- README/CUSTOMIZE branding; re-synced the Studio sample copy to this branch's
  (specialist) agent.yaml

Unchanged on purpose: the `is_likely_phishing` verdict schema, the
`phishing-analyzer` sub-agent (it IS the phishing specialist), and domain
references to phishing.

Verified: AgentConfig validate + Fabric translate; ruff; 8/8 tool tests; Studio
loader tests; zero stragglers; and live create -> deploy -> invoke under the new
slug returns is_likely_phishing: true (renamed console script resolves).

Signed-off-by: Nathan Walston <nwalston@nvidia.com>

* docs(nemo-agents): name both delegated roles in triage goal

Signed-off-by: Nathan Walston <nwalston@nvidia.com>

---------

Signed-off-by: Nathan Walston <nwalston@nvidia.com>
Co-authored-by: Octavian Drulea <odrulea@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants