dangerous_request_configTier 1 · 70% confidence

security-dangerous-request-co-using-create-openapi-agent-without-setting-allow-d-d304b9a9

agent: security

When does this happen?

IF Using create_openapi_agent without setting allow_dangerous_requests=True raises a ValueError: 'You must set allow_dangerous_requests to True to use this tool.'

How others solved it

THEN Pass allow_dangerous_requests=True as a keyword argument to planner.create_openapi_agent. If the version does not forward this parameter (e.g., langchain-community 0.0.29), manually edit the planner.py file to add allow_dangerous_requests=True to the RequestsGetToolWithParsing and RequestsPostToolWithParsing constructors.

In langchain_community/agent_toolkits/openapi/planner.py, modify:
RequestsGetToolWithParsing(requests_wrapper=requests_wrapper, llm_chain=get_llm_chain, allow_dangerous_requests=True)
RequestsPostToolWithParsing(requests_wrapper=requests_wrapper, llm_chain=post_llm_chain, allow_dangerous_requests=True)

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics