I have a LangGraph agent that scans a corpus of documents with various shell tools like grep, ls, sed, etc to answer a question.
With the same input prompt roughly 50% of the time the agent gets stopped with a 400 invalid prompt error:
✖ ERROR: (app_configure.aitl_monitor._run_agent:326) [AITL Monitor] Agent launch failed for ticket id=21: Error code: 400 - {'error': {'message': 'Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_prompt'}}
It’s never at the beginning and it’s always after the agent has started scanning the Knowledge Base.
The questions this agent processes are ALWAYS send to it by other OpenAI agents.
The Knowledge Base it is accessing is simply documentation over the web application our company runs.
The chat history does not trigger the moderation API at all. I do not know what is wrong.