Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
###### Place new entries directly below this line! ######
node_modules/
/.codex

# auto-generated chainlit stuff
Expand Down
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The examples in the NeMo-Agent-Toolkit-Examples repository are community contrib
- **[NeMo Agent Toolkit Components](#nemo-agent-toolkit-components)**
- [Agents](#agents)
- [Advanced Agents](#advanced-agents)
- [Experimental](#experimental)
- [Configuration](#configuration)
- [Control Flow](#control-flow)
- [Custom Functions](#custom-functions)
Expand Down Expand Up @@ -104,6 +105,13 @@ _Additional information can be found in the [Agents README](./agents/README.md).
- **[`alert_triage_agent`](advanced_agents/alert_triage_agent/README.md)**: Production-ready intelligent alert triage system using LangGraph that automates system monitoring diagnostics with tools for hardware checks, network connectivity, performance analysis, and generates structured triage reports with root cause categorization **[🟨 Intermediate]**
- **[`vulnerability_analysis_blueprint`](advanced_agents/vulnerability_analysis_blueprint/README.md)**: Blueprint documentation for vulnerability analysis agents **[🛑 Advanced]**

### Experimental
- **[`claude_code_agent_adapter`](experimental/claude_code_agent_adapter/README.md)**: Experimental primitive agent workflow backed by the Claude Code Agent SDK with a conservative local smoke-test config. **[🛑 Advanced]**
- **[`codex_agent_adapter`](experimental/codex_agent_adapter/README.md)**: Experimental primitive agent workflow backed by Codex SDK in read-only mode. **[🛑 Advanced]**
- **[`cursor_agent_adapter`](experimental/cursor_agent_adapter/README.md)**: Experimental primitive agent workflow backed by Cursor Agent CLI in plan mode. **[🛑 Advanced]**
- **[`openclaw_agent_adapter`](experimental/openclaw_agent_adapter/README.md)**: Experimental primitive agent workflow backed by OpenClaw CLI one-shot runs. **[🛑 Advanced]**
- **[`hermes_agent_adapter`](experimental/hermes_agent_adapter/README.md)**: Experimental primitive agent workflow backed by Hermes Agent CLI one-shot mode. **[🛑 Advanced]**

### Configuration
- **[`config_inheritance`](config_inheritance/README.md)**: Use YAML configuration inheritance in the NeMo Agent Toolkit to reduce duplication across similar configuration files **[🟢 Beginner]**

Expand Down
104 changes: 104 additions & 0 deletions examples/experimental/claude_code_agent_adapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!--
SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Claude Code Adapter

This experimental NVIDIA NeMo Agent Toolkit example prototypes a primitive agent workflow type backed by the Claude Code Agent SDK.

The adapter is intentionally conservative:

- It accepts the same `ChatRequestOrMessage` input shape used by built-in workflow agents.
- Its config subclasses NAT's `AgentBaseConfig`; `llm_name` is optional because Claude Code Agent SDK manages model selection through `model`.
- Operational controls live in YAML config rather than an NAT `llms:` block.
- The default SDK permission mode is `plan`.

## Installation And Setup

If you have not already done so, follow the instructions in the [Install Guide](../../../docs/source/get-started/installation.md#install-from-source) to create the development environment and install NeMo Agent Toolkit.

### Install This Workflow

From the root directory of the NeMo Agent Toolkit library, run:

```bash
uv pip install -e examples/experimental/claude_code_agent_adapter
```

## Run The Workflow

For local end-to-end testing, authenticate Claude Code in the same shell or user profile that launches `nat`:

```bash
claude auth status
claude auth login
```

If `claude auth status` shows an active NVIDIA SSO-backed Claude login, run the live config:

```bash
nat run \
--config_file examples/experimental/claude_code_agent_adapter/configs/config.yml \
--input "Inspect the experimental Claude Code agent adapter and summarize how it registers with NAT. Do not edit files."
```

`configs/config.yml` keeps `permission_mode: plan`, uses the `sonnet` model alias, caps `max_budget_usd`, and denies write-oriented tools for the first live smoke test.

## Direct Workflow

`configs/config.yml` wires the adapter directly as the workflow:

```yaml
workflow:
_type: claude_code_agent
permission_mode: plan
model: sonnet
working_directory: .
setting_sources: [project]
max_turns: 10
max_budget_usd: 1.00
disallowed_tools:
- Bash
- Edit
- MultiEdit
- NotebookEdit
- Write
```

## Configurable Options

- `working_directory`
- `llm_name` (accepted for NAT agent config consistency, unused by the SDK agent)
- `permission_mode`
- `model`
- `append_system_prompt`
- `allowed_tools`
- `disallowed_tools`
- `setting_sources`
- `additional_directories`
- `max_turns`
- `max_budget_usd`
- `timeout_seconds`
- `max_output_chars`
- `max_history`

## Authentication

The adapter does not require credentials in YAML. In live mode, the Claude Agent SDK follows Claude Code authentication in the launching environment. For local testing, an NVIDIA SSO-backed Claude Code login can be used if `claude auth status` reports an active login in the same shell/user profile. Stale `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` environment variables can take precedence over that login.

## Notes

Live execution should stay opt-in until permission, sandboxing, credentials, and cost controls are reviewed. The current agent implementation uses `claude_agent_sdk.query()` and `ClaudeAgentOptions`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

workflow:
_type: claude_code_agent
permission_mode: plan
model: sonnet
working_directory: .
setting_sources: [project]
max_turns: 10
max_budget_usd: 1.00
timeout_seconds: 120
max_output_chars: 12000
disallowed_tools:
- Bash
- Edit
- MultiEdit
- NotebookEdit
- Write
45 changes: 45 additions & 0 deletions examples/experimental/claude_code_agent_adapter/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64", "setuptools-scm>=8", "setuptools_dynamic_dependencies>=1.0.0"]

[tool.setuptools_scm]
git_describe_command = "git describe --long --first-parent"
root = "../../.."

[tool.setuptools.packages.find]
where = ["src"]

[project]
name = "nat_claude_code_agent_adapter"
dynamic = ["version", "dependencies"]
requires-python = ">=3.11,<3.14"
description = "Experimental Claude Code agent for the NeMo Agent Toolkit"
keywords = ["ai", "agents", "coding-agents"]
classifiers = ["Programming Language :: Python"]

[tool.setuptools_dynamic_dependencies]
dependencies = [
"claude-agent-sdk>=0.1.60",
"nvidia-nat[langchain] == {version}",
]

[tool.uv.sources]
nvidia-nat = { path = "../../..", editable = true }

[project.entry-points.'nat.components']
nat_claude_code_agent_adapter = "nat_claude_code_agent_adapter.register"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Experimental Claude Code adapter example."""
Loading
Loading