Got this error in V1 CLI :eyes: ``` Error: LLM pro...
# feedback
c
Got this error in V1 CLI šŸ‘€
Copy code
Error: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
Traceback (most recent call last):
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/simple_main.py", line 45, in main
    run_cli_entry(resume_conversation_id=args.resume)
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/agent_chat.py", line 173, in run_cli_entry
    runner.process_message(message)
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/runner.py", line 83, in process_message
    self._run_with_confirmation()
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/runner.py", line 103, in _run_with_confirmation
    self.conversation.run()
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
    self.agent.step(self._state, on_event=self._on_event)
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 226, in step
    action_event = self._get_action_event(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 353, in _get_action_event
    raise RuntimeError(
RuntimeError: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
Traceback (most recent call last):
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/bin/openhands", line 12, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/simple_main.py", line 45, in main
    run_cli_entry(resume_conversation_id=args.resume)
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/agent_chat.py", line 173, in run_cli_entry
    runner.process_message(message)
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/runner.py", line 83, in process_message
    self._run_with_confirmation()
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands_cli/runner.py", line 103, in _run_with_confirmation
    self.conversation.run()
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
    self.agent.step(self._state, on_event=self._on_event)
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 226, in step
    action_event = self._get_action_event(
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xingyaow/.cache/uv/archive-v0/4O2s5H4GUkriWq5g6YjrC/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 353, in _get_action_event
    raise RuntimeError(
RuntimeError: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
@nutritious-balloon-65098 please create an issue in All-Hands-AI/OpenHands repo
n
I'm on it! Xingyao Wang can track my progress here.
Summary I have successfully created a GitHub issue in the All-Hands-AI/OpenHands repository for the CLI V1 bug you reported. Issue Created: #11309 - CLI V1 crashes with 'LLM provided a security_risk but no security analyzer is configured' What was included in the issue: Problem Description: • Clear description of the RuntimeError that occurs when using OpenHands CLI V1 • The error happens when the LLM returns a
security_risk
parameter but no security analyzer is configured Root Cause Analysis: • Identified that the issue stems from the interaction between: a. The CLI's
setup_conversation()
function that conditionally includes security analyzers b. The
toggle_confirmation_mode()
function that removes the security analyzer when confirmation mode is disabled c. The LLM still returning
security_risk
parameters in responses d. The openhands-sdk expecting a security analyzer when
security_risk
is present Suggested Fixes: • Three potential approaches: SDK-side fix, CLI-side fix, or LLM prompt fix Complete Error Traceback: • Full stack trace showing the error originates from
openhands/sdk/agent/agent.py
line 353 Related Information: • Linked to recent commit 9fe4e9715 ("CLI(V1): Fix confirmation mode breaking on weaker models") • Listed relevant files in the codebase • Noted the SDK dependency version (commit 189979a5013751aa86852ab41afe9a79555e62ac) • Highlighted the impact: makes CLI unusable for affected users The issue is now tracked and can be reviewed by the OpenHands team for resolution. <sub>View full conversation</sub>
q
šŸ‘†left some comments on the issue I believe i had made a breaking change recently lmk if you can repro the issue after resetting your agent settings
šŸ‘ 1
c
This is also kind werid and maybe related: 1. I select LLM risk analyzer 2. It prompts me for confirmation on an FileEditorAction (which we don't really ask LLM to predict risk for) 3. CLI prompts me for confirmation again and i select "always" 4. CLI keep going and run into the same error above
ty 1
thonk 1
i'll clean up my agent_settings and try to see if i can fix it
maybe you can add an instruction to the error message to remind user to delete their agent_settings?
q
Since its the first release didn't do it, but moving forward we should have that process for sure
It prompts me for confirmation on an FileEditorAction (which we don't really ask LLM to predict risk for)
Ah this seems fishy will dig into it
c
I cleaned up my agent settings, and launch from main, run into this error again 😰 This time i only clicked "always allow" ONCE
Error: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
Traceback (most recent call last):
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/simple_main.py", line 45, in main
run_cli_entry(resume_conversation_id=args.resume)
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/agent_chat.py", line 173, in run_cli_entry
runner.process_message(message)
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/runner.py", line 83, in process_message
self._run_with_confirmation()
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/runner.py", line 103, in _run_with_confirmation
self.conversation.run()
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
self.agent.step(self._state, on_event=self._on_event)
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 226, in step
action_event = self._get_action_event(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 353, in _get_action_event
raise RuntimeError(
RuntimeError: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
Traceback (most recent call last):
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/bin/openhands", line 12, in <module>
sys.exit(main())
^^^^^^
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/simple_main.py", line 45, in main
run_cli_entry(resume_conversation_id=args.resume)
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/agent_chat.py", line 173, in run_cli_entry
runner.process_message(message)
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/runner.py", line 83, in process_message
self._run_with_confirmation()
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands_cli/runner.py", line 103, in _run_with_confirmation
self.conversation.run()
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
self.agent.step(self._state, on_event=self._on_event)
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 226, in step
action_event = self._get_action_event(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xingyaow/.cache/uv/archive-v0/Uqy_3HcNJFJ00FSWlWQlK/lib/python3.12/site-packages/openhands/sdk/agent/agent.py", line 353, in _get_action_event
raise RuntimeError(
RuntimeError: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
q
AH thanks ill patch this in asap
huh i don't see this error which version/commit of cli are you running?
c
you will need it have it running for a while
it doesn't immediately show up
maybe you can prompt it to run bash action later with security risk
another way to check would be checking if the "security risk" is sent to agent as an tool arg
q
is this a problem upstream with the sdk? the conversation was initialized with an agent that doesn't have a security analyzer the tool still has a security risk field, and sometimes the agent will specify the field even though the system prompt instructions for it are missing
n
Uh oh! There was an unexpected error starting the job :(
c
ugh the convo is not started
This is very weird @nutritious-balloon-65098 creates an issue on All-Hands-AI/agent-sdk, we should check if the security_risk field is in the system prompt when security analyzer is turned off. We should also omit the security_risk field (don't throw pydantic error) when security analyzer is not enabled
n
Conversation is still starting
c
This is very weird @nutritious-balloon-65098 creates an issue on All-Hands-AI/agent-sdk, we should check if the security_risk field is in the system prompt when security analyzer is turned off. We should also omit the security_risk field (don't throw pydantic error) when security analyzer is not enabled
n
Conversation is still starting
facepalm 2
q
https://github.com/All-Hands-AI/agent-sdk/pull/708 - seems like OH was able to repro the problem security risk field still exist in tools even though no security analyzer is added to the agent
c
ah i guess fixing this should resolve the issue facepalm
q
hmm actually oh repro-ed this incorrectly but will keep digging will have something ready today
šŸ™Œ 1
a
I downloaded the cli binary today, set my advanced llm settings, and then tried asking the cli to analyze a directory and I immediately got hit with this error after I selected the auto-confirm command (never ask again) option:
Copy code
Error: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
Traceback (most recent call last):
  File "openhands_cli/simple_main.py", line 45, in main
  File "openhands_cli/agent_chat.py", line 173, in run_cli_entry
  File "openhands_cli/runner.py", line 83, in process_message
  File "openhands_cli/runner.py", line 103, in _run_with_confirmation
  File "openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
  File "openhands/sdk/agent/agent.py", line 226, in step
  File "openhands/sdk/agent/agent.py", line 353, in _get_action_event
RuntimeError: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
Traceback (most recent call last):
  File "openhands_cli/simple_main.py", line 59, in module
  File "openhands_cli/simple_main.py", line 45, in main
  File "openhands_cli/agent_chat.py", line 173, in run_cli_entry
  File "openhands_cli/runner.py", line 83, in process_message
  File "openhands_cli/runner.py", line 103, in _run_with_confirmation
  File "openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
  File "openhands/sdk/agent/agent.py", line 226, in step
  File "openhands/sdk/agent/agent.py", line 353, in _get_action_event
RuntimeError: LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!
[PYI-88958:ERROR] Failed to execute script 'simple_main' due to unhandled exception!
alonaking@MacBook-Pro-82 All-Hands %
Not sure how to go back and grab the convo ID or any additional cli logs.. but just wanted to add an additional datapoint..
q
thanks! this is helpful
@chilly-france-44439 could this be because 1. the system prompt is set exactly once (with security analyzer descriptions) 2. even if the tool param doesn't contain
security_risk
field, the agent can still pass it as an argument and we see this runtime error before the tool arguments are validated by pydantic? Specifically for the area in the PR linked below, it seems we pop the raw arguments and validate security risk against the security analyzer (which is set to
None
appropriately) https://github.com/All-Hands-AI/agent-sdk/pull/723/files
Ah I see a comment where it says "Arguments we passed in should not contains `security_risk`" when validating the tool arguments Since the system prompt is immutable, the agent passes in
security_risk
anyways even when confirmation mode is disabled - i'll clean up this patch but it seems like a reasonable workaround for now lmk
c
the system prompt is set exactly once (with security analyzer descriptions)
I think this was also my assumption -- although it just run into a very weird scenario: it is start with LLM-Risk analyzer, and then at some point it turns into a "confirm on every action", and then it throws the same "LLM provided a security_risk but no security analyzer is configured - THIS SHOULD NOT HAPPEN!" error
is there anyway to always enable confirmation mode šŸ¤” eg if i set my preference to be always LLM-risk analyzer or Always approve, it should remember my setting on every convo restart
I think it is almost always reproducible now for me šŸ¤”
q
Yep I think that's expected, especially because the agent decides on whim whether or not to include the security risk (based on system prompt). But once it does, we 100% crash (if no security analyzer exists) the PR I linked fixes this: https://github.com/All-Hands-AI/agent-sdk/pull/723/files Still cleaning up the tests right now > start with LLM-Risk analyzer, and then at some point it turns into a "confirm on every action" Every conversation begins with confirm on every action. This can be changed while the agent runs. However, if you've enabled LLM based risk analyzer and we're still blocking low risk actions its probably a separate bug
c
Yeah i think that's sort of the root issue for me: 1. I started with LLM-based analyzer + AlwaysConfirm 2. Somehow, the agent got to [no security analyzer] + Always Confirm state while running 3. And this is what breaks the conversation for me šŸ¤”
q
Oh just to confirm you're getting there when selecting "Yes Proceed" instead of "Always Proceed"?
c
Another weird thing is that the convo I just shared has
NeverConfirm
on the base state
nah, i got there when i select Always Proceed
If i select "Yes Proceed", security risk analyzer seems to go away too (it will prompts me for confirmation on every action now)
q
Always proceed (i.e don't confirm any actions whatsoever) should have 1. no security analyzer 2. never confirm policy so that's expected šŸ¤” the conversation crashes because of the bug I described above
šŸ‘ 1