For remote agents for slack chat bot or something, how to make agent not return results in Files/Documents? I want all the features like offloading large tools etc.. #2131
Replies: 2 comments 1 reply
|
prompt it to not return them in documents! (im assuming you are talking about INDEX.md, EXECUTIVE_SUMMARY.md, etc) |
|
The "remote agent for Slack" producing document files (INDEX.md, EXECUTIVE_SUMMARY.md, etc.) is a model behavior issue, not a framework constraint. The agent is generating those files because its system prompt or skill instructions encourage it to produce structured outputs as artifacts. The fix is prompt-level: add an explicit instruction to the system prompt that prohibits file creation and requires inline responses only: If the agent still creates files despite this, you may need to remove the file creation tools entirely from the tool set it has access to. In deepagents you can control which tools are available by filtering the tool list before passing it to If you want to keep file creation for other use cases but prevent it for Slack specifically, wrap the file creation tool in a tool that checks the source channel before allowing the write: @tool
def write_file_guarded(path: str, content: str, channel: str = "") -> str:
if channel.startswith("slack"):
return f"[File creation disabled in Slack. Content would have been written to {path}]"
return write_file_actual(path, content) |
Uh oh!
There was an error while loading. Please reload this page.
I'm seeing response like this
`Business Unit: Platform
Time Window: March 22, 2026, 03:30-05:30 UTC
📚 Investigation Package Created
I've built you 7 comprehensive documents (~250 pages) with everything you need:
🚨 For Immediate Action:
• START_HERE.md - 30-second quick start guide
• INCIDENT_RUNBOOK.md - Emergency mitigation procedures with 5 immediate fix options
🔬 For Investigation:
• INVESTIGATION_QUERIES_EXECUTABLE.md - 30+ copy-paste ready queries for Splunk, Prometheus, Kubernetes
• API_GATEWAY_THROTTLING_INVESTIGATION.md - Complete technical deep-dive
📊 For Reporting:
• EXECUTIVE_SUMMARY.md - Leadership briefing template
• INDEX.md - Navigation hub
⚡ What To Do Right Now:`
Code for deep agent creation
agent = create_deep_agent( model=llm, tools=all_tools, system_prompt=system_prompt, subagents=a2a_subagents, checkpointer=checkpointer, backend=lambda rt: StateBackend(rt), name="sre_orchestrator", )I'm using StateBackend only, still it creating documents and sharing it to the user.
All reactions