nvidia-nat 1.3.0a20251009__py3-none-any.whl → 1.3.0a20251012__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,7 +162,7 @@ async def react_agent_workflow(config: ReActAgentWorkflowConfig, builder: Builde
162
162
  return GlobalTypeConverter.get().convert(response, to_type=str)
163
163
  return response
164
164
  except Exception as ex:
165
- logger.exception("%s ReAct Agent failed with exception: %s", AGENT_LOG_PREFIX, str(ex))
166
- raise RuntimeError
165
+ logger.error("%s ReAct Agent failed with exception: %s", AGENT_LOG_PREFIX, str(ex))
166
+ raise
167
167
 
168
168
  yield FunctionInfo.from_fn(_response_fn, description=config.description)
@@ -169,7 +169,7 @@ async def rewoo_agent_workflow(config: ReWOOAgentWorkflowConfig, builder: Builde
169
169
  return GlobalTypeConverter.get().convert(response, to_type=str)
170
170
  return response
171
171
  except Exception as ex:
172
- logger.exception("ReWOO Agent failed with exception: %s", ex)
173
- raise RuntimeError
172
+ logger.error("ReWOO Agent failed with exception: %s", ex)
173
+ raise
174
174
 
175
175
  yield FunctionInfo.from_fn(_response_fn, description=config.description)
@@ -118,8 +118,8 @@ async def tool_calling_agent_workflow(config: ToolCallAgentWorkflowConfig, build
118
118
  output_message = state.messages[-1]
119
119
  return str(output_message.content)
120
120
  except Exception as ex:
121
- logger.exception("%s Tool Calling Agent failed with exception: %s", AGENT_LOG_PREFIX, ex)
122
- raise RuntimeError
121
+ logger.error("%s Tool Calling Agent failed with exception: %s", AGENT_LOG_PREFIX, ex)
122
+ raise
123
123
 
124
124
  try:
125
125
  yield FunctionInfo.from_fn(_response_fn, description=config.description)
nat/builder/function.py CHANGED
@@ -159,8 +159,7 @@ class Function(FunctionBase[InputT, StreamingOutputT, SingleOutputT], ABC):
159
159
 
160
160
  return result
161
161
  except Exception as e:
162
- err_msg = f"Error: {e}" if str(e).strip() else ""
163
- logger.error("Error with ainvoke in function with input: %s. %s", value, err_msg)
162
+ logger.error("Error with ainvoke in function with input: %s. Error: %s", value, e)
164
163
  raise
165
164
 
166
165
  @typing.final
@@ -13,13 +13,17 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
+ import logging
16
17
  from typing import Literal
17
18
 
18
19
  from pydantic import Field
20
+ from pydantic import model_validator
19
21
 
20
22
  from nat.authentication.oauth2.oauth2_resource_server_config import OAuth2ResourceServerConfig
21
23
  from nat.data_models.front_end import FrontEndBaseConfig
22
24
 
25
+ logger = logging.getLogger(__name__)
26
+
23
27
 
24
28
  class MCPFrontEndConfig(FrontEndBaseConfig, name="mcp"):
25
29
  """MCP front end configuration.
@@ -43,3 +47,31 @@ class MCPFrontEndConfig(FrontEndBaseConfig, name="mcp"):
43
47
 
44
48
  server_auth: OAuth2ResourceServerConfig | None = Field(
45
49
  default=None, description=("OAuth 2.0 Resource Server configuration for token verification."))
50
+
51
+ @model_validator(mode="after")
52
+ def validate_security_configuration(self):
53
+ """Validate security configuration to prevent accidental misconfigurations."""
54
+ # Check if server is bound to a non-localhost interface without authentication
55
+ localhost_hosts = {"localhost", "127.0.0.1", "::1"}
56
+ if self.host not in localhost_hosts and self.server_auth is None:
57
+ logger.warning(
58
+ "MCP server is configured to bind to '%s' without authentication. "
59
+ "This may expose your server to unauthorized access. "
60
+ "Consider either: (1) binding to localhost for local-only access, "
61
+ "or (2) configuring server_auth for production deployments on public interfaces.",
62
+ self.host)
63
+
64
+ # Check if SSE transport is used (which doesn't support authentication)
65
+ if self.transport == "sse":
66
+ if self.server_auth is not None:
67
+ logger.warning("SSE transport does not support authentication. "
68
+ "The configured server_auth will be ignored. "
69
+ "For production use with authentication, use 'streamable-http' transport instead.")
70
+ elif self.host not in localhost_hosts:
71
+ logger.warning(
72
+ "SSE transport does not support authentication and is bound to '%s'. "
73
+ "This configuration is not recommended for production use. "
74
+ "For production deployments, use 'streamable-http' transport with server_auth configured.",
75
+ self.host)
76
+
77
+ return self
nat/runtime/runner.py CHANGED
@@ -196,8 +196,7 @@ class Runner:
196
196
 
197
197
  return result
198
198
  except Exception as e:
199
- err_msg = f": {e}" if str(e).strip() else "."
200
- logger.error("Error running workflow%s", err_msg)
199
+ logger.error("Error running workflow: %s", e)
201
200
  event_stream = self._context_state.event_stream.get()
202
201
  if event_stream:
203
202
  event_stream.on_complete()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nvidia-nat
3
- Version: 1.3.0a20251009
3
+ Version: 1.3.0a20251012
4
4
  Summary: NVIDIA NeMo Agent toolkit
5
5
  Author: NVIDIA Corporation
6
6
  Maintainer: NVIDIA Corporation
@@ -10,16 +10,16 @@ nat/agent/react_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
10
10
  nat/agent/react_agent/agent.py,sha256=sWrg9WrglTKQQyG3EcjNm2JTEchCPEo9li-Po7TJKss,21294
11
11
  nat/agent/react_agent/output_parser.py,sha256=m7K6wRwtckBBpAHqOf3BZ9mqZLwrP13Kxz5fvNxbyZE,4219
12
12
  nat/agent/react_agent/prompt.py,sha256=N47JJrT6xwYQCv1jedHhlul2AE7EfKsSYfAbgJwWRew,1758
13
- nat/agent/react_agent/register.py,sha256=lpiso1tKq70ZYKbV9zXZegtXPLJNBaBrnG25R9hyA9Q,9008
13
+ nat/agent/react_agent/register.py,sha256=qkPaK6AvXjolL-q_Z3waVobXDz24GMfuqGqCn-2un2Q,8991
14
14
  nat/agent/reasoning_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  nat/agent/reasoning_agent/reasoning_agent.py,sha256=k_0wEDqACQn1Rn1MAKxoXyqOKsthHCQ1gt990YYUqHU,9575
16
16
  nat/agent/rewoo_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  nat/agent/rewoo_agent/agent.py,sha256=XXgVXY9xwkyxnr093KXUtfgyNxAQbyGAecoGqN5mMLY,26199
18
18
  nat/agent/rewoo_agent/prompt.py,sha256=B0JeL1xDX4VKcShlkkviEcAsOKAwzSlX8NcAQdmUUPw,3645
19
- nat/agent/rewoo_agent/register.py,sha256=s6D9W4x5jIkda8l67gj3A46aefk6KQPuZ4H-ZJkVAtY,9300
19
+ nat/agent/rewoo_agent/register.py,sha256=XArlOR37QOBtAvsdKJUjRok5qTmx39S2mJHSteOwU58,9283
20
20
  nat/agent/tool_calling_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  nat/agent/tool_calling_agent/agent.py,sha256=4SIp29I56oznPRQu7B3HCoX53Ri3_o3BRRYNJjeBkF8,11006
22
- nat/agent/tool_calling_agent/register.py,sha256=h1Xfr1KPvQkslPg-NqdOMQAmx1PNFAIvvOC5bAIJtbE,7074
22
+ nat/agent/tool_calling_agent/register.py,sha256=OucceyELA2xZL3KdANWK9w12fnVP75eVbZgzOnmXHys,7057
23
23
  nat/authentication/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
24
24
  nat/authentication/interfaces.py,sha256=1J2CWEJ_n6CLA3_HD3XV28CSbyfxrPAHzr7Q4kKDFdc,3511
25
25
  nat/authentication/register.py,sha256=lFhswYUk9iZ53mq33fClR9UfjJPdjGIivGGNHQeWiYo,915
@@ -48,7 +48,7 @@ nat/builder/eval_builder.py,sha256=I-ScvupmorClYoVBIs_PhSsB7Xf9e2nGWe0rCZp3txo,6
48
48
  nat/builder/evaluator.py,sha256=xWHMND2vcAUkdFP7FU3jnVki1rUHeTa0-9saFh2hWKs,1162
49
49
  nat/builder/framework_enum.py,sha256=n7IaTQBxhFozIQqRMcX9kXntw28JhFzCj82jJ0C5tNU,901
50
50
  nat/builder/front_end.py,sha256=FCJ87NSshVVuTg8zZrq3YAr_u0RaYVZVcibnqlRFy-M,2173
51
- nat/builder/function.py,sha256=3h51TA0D6EQGWjHDsoxa_8ooQcZpk_-yAndk4oc5dGo,27790
51
+ nat/builder/function.py,sha256=eZZWLwhphgQTnPvbga8sGleX7HCP46usZPIegE7zFzs,27725
52
52
  nat/builder/function_base.py,sha256=0Eg8RtjWhEU3Yme0CVxcRutobA0Qo8-YHZLI6L2qAgM,13116
53
53
  nat/builder/function_info.py,sha256=7Rmrn-gOFrT2TIJklJwA_O-ycx_oimwZ0-qMYpbuZrU,25161
54
54
  nat/builder/intermediate_step_manager.py,sha256=iOuMLWTaES0J0XzaLxhTUqFvuoCAChJu3V69T43K0k0,7599
@@ -259,7 +259,7 @@ nat/front_ends/fastapi/html_snippets/__init__.py,sha256=GUJrgGtpvyMUCjUBvR3faAdv
259
259
  nat/front_ends/fastapi/html_snippets/auth_code_grant_success.py,sha256=BNpWwzmA58UM0GK4kZXG4PHJy_5K9ihaVHu8SgCs5JA,1131
260
260
  nat/front_ends/mcp/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
261
261
  nat/front_ends/mcp/introspection_token_verifier.py,sha256=s7Q4Q6rWZJ0ZVujSxxpvVI6Bnhkg1LJQ3RLkvhzFIGE,2836
262
- nat/front_ends/mcp/mcp_front_end_config.py,sha256=fFbg800FDJfwv-nXc0jEPaNVtW4ApESmVRexr-werks,2313
262
+ nat/front_ends/mcp/mcp_front_end_config.py,sha256=m6z5qSz8YGnFnfu8hRID69suvO1YT_L6sxy1Ki64Ufw,4042
263
263
  nat/front_ends/mcp/mcp_front_end_plugin.py,sha256=NiIIgApk1X2yAEwtG9tHaY6SexQMbZrd6Drs7uIJix8,5055
264
264
  nat/front_ends/mcp/mcp_front_end_plugin_worker.py,sha256=jMclC0qEd910oTGCqd1kQ8WjP3WPdQKTl854-2bU_KI,10200
265
265
  nat/front_ends/mcp/register.py,sha256=3aJtgG5VaiqujoeU1-Eq7Hl5pWslIlIwGFU2ASLTXgM,1173
@@ -406,7 +406,7 @@ nat/retriever/nemo_retriever/register.py,sha256=3XdrvEJzX2Zc8wpdm__4YYlEWBW-FK3t
406
406
  nat/retriever/nemo_retriever/retriever.py,sha256=gi3_qJFqE-iqRh3of_cmJg-SwzaQ3z24zA9LwY_MSLY,6930
407
407
  nat/runtime/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
408
408
  nat/runtime/loader.py,sha256=obUdAgZVYCPGC0R8u3wcoKFJzzSPQgJvrbU4OWygtog,7953
409
- nat/runtime/runner.py,sha256=sUF-zJMgqcFq4xRx8y5bxct2EzgiKbmFkvWkYxlDsQg,11798
409
+ nat/runtime/runner.py,sha256=qa_AqtmB8TUHX6nVJ0TLEYCKUsm2L99kq5O72AuL3yc,11736
410
410
  nat/runtime/session.py,sha256=E8RTbnAhPbY5KCoSfiHzOJksmBh7xWjsoX0BC7Rn1ck,9101
411
411
  nat/runtime/user_metadata.py,sha256=ce37NRYJWnMOWk6A7VAQ1GQztjMmkhMOq-uYf2gNCwo,3692
412
412
  nat/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -470,10 +470,10 @@ nat/utils/reactive/base/observer_base.py,sha256=6BiQfx26EMumotJ3KoVcdmFBYR_fnAss
470
470
  nat/utils/reactive/base/subject_base.py,sha256=UQOxlkZTIeeyYmG5qLtDpNf_63Y7p-doEeUA08_R8ME,2521
471
471
  nat/utils/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
472
472
  nat/utils/settings/global_settings.py,sha256=9JaO6pxKT_Pjw6rxJRsRlFCXdVKCl_xUKU2QHZQWWNM,7294
473
- nvidia_nat-1.3.0a20251009.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
474
- nvidia_nat-1.3.0a20251009.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
475
- nvidia_nat-1.3.0a20251009.dist-info/METADATA,sha256=4vRqn410h3ctm5GgR97zDJjNH1pCPmp6z9bq6jLeO-E,10228
476
- nvidia_nat-1.3.0a20251009.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
477
- nvidia_nat-1.3.0a20251009.dist-info/entry_points.txt,sha256=4jCqjyETMpyoWbCBf4GalZU8I_wbstpzwQNezdAVbbo,698
478
- nvidia_nat-1.3.0a20251009.dist-info/top_level.txt,sha256=lgJWLkigiVZuZ_O1nxVnD_ziYBwgpE2OStdaCduMEGc,8
479
- nvidia_nat-1.3.0a20251009.dist-info/RECORD,,
473
+ nvidia_nat-1.3.0a20251012.dist-info/licenses/LICENSE-3rd-party.txt,sha256=fOk5jMmCX9YoKWyYzTtfgl-SUy477audFC5hNY4oP7Q,284609
474
+ nvidia_nat-1.3.0a20251012.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
475
+ nvidia_nat-1.3.0a20251012.dist-info/METADATA,sha256=0lluHjvpalyT5y2KRVPW93RUp1APbdwJQ8kazjllphs,10228
476
+ nvidia_nat-1.3.0a20251012.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
477
+ nvidia_nat-1.3.0a20251012.dist-info/entry_points.txt,sha256=4jCqjyETMpyoWbCBf4GalZU8I_wbstpzwQNezdAVbbo,698
478
+ nvidia_nat-1.3.0a20251012.dist-info/top_level.txt,sha256=lgJWLkigiVZuZ_O1nxVnD_ziYBwgpE2OStdaCduMEGc,8
479
+ nvidia_nat-1.3.0a20251012.dist-info/RECORD,,