Skip to content

Commit 56bff7b

Browse files
mehtaraczastrowm
andauthored
Add docs regarding BYPASS_TOOL_CONSENT and fix other minor docs issues (#82)
* Add docs regarding BYPASS_TOOL_CONSENT and fix other minor docs issues * Add docs regarding BYPASS_TOOL_CONSENT and fix other minor docs issues * Update docs/user-guide/concepts/tools/example-tools-package.md Co-authored-by: Mackenzie Zastrow <[email protected]> * Update docs/user-guide/concepts/tools/example-tools-package.md Co-authored-by: Mackenzie Zastrow <[email protected]> --------- Co-authored-by: Mackenzie Zastrow <[email protected]>
1 parent d78e830 commit 56bff7b

File tree

4 files changed

+54
-40
lines changed

4 files changed

+54
-40
lines changed

docs/examples/python/memory_agent.md

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,34 +32,20 @@ The memory agent utilizes two primary tools:
3232

3333
This example demonstrates a workflow where memories are used to generate contextually relevant responses:
3434

35-
```
36-
┌─────────────────┐ ┌─────────────────────────┐ ┌─────────────────────────┐
37-
│ │ │ │ │ │
38-
│ User Query │────▶│ Command Classification │────▶│ Conditional Execution │
39-
│ │ │ (store/retrieve/list) │ │ Based on Command Type │
40-
│ │ │ │ │ │
41-
└─────────────────┘ └─────────────────────────┘ └───────────┬─────────────┘
42-
43-
44-
45-
┌───────────────────────────────────────────────────────┐
46-
│ │
47-
│ Store Action List Action Retrieve Action │
48-
│ ┌───────────┐ ┌───────────┐ ┌───────────────┐ │
49-
│ │ │ │ │ │ │ │
50-
│ │ mem0() │ │ mem0() │ │ mem0() │ │
51-
│ │ (store) │ │ (list) │ │ (retrieve) │ │
52-
│ │ │ │ │ │ │ │
53-
│ └───────────┘ └───────────┘ └───────┬───────┘ │
54-
│ │ │
55-
│ ▼ │
56-
│ ┌───────────┐ │
57-
│ │ │ │
58-
│ │ use_llm() │ │
59-
│ │ │ │
60-
│ └───────────┘ │
61-
│ │
62-
└──────────────────────────────────────────────────────┘
35+
```mermaid
36+
flowchart TD
37+
UserQuery["User Query"] --> CommandClassification["Command Classification<br>(store/retrieve/list)"]
38+
CommandClassification --> ConditionalExecution["Conditional Execution<br>Based on Command Type"]
39+
40+
ConditionalExecution --> ActionContainer["Memory Operations"]
41+
42+
subgraph ActionContainer[Memory Operations]
43+
StoreAction["Store Action<br><br>mem0()<br>(store)"]
44+
ListAction["List Action<br><br>mem0()<br>(list)"]
45+
RetrieveAction["Retrieve Action<br><br>mem0()<br>(retrieve)"]
46+
end
47+
48+
RetrieveAction --> UseLLM["use_llm()"]
6349
```
6450

6551
### Key Workflow Components
@@ -126,15 +112,12 @@ This example demonstrates a workflow where memories are used to generate context
126112

127113
The retrieval path demonstrates tool chaining, where memory retrieval and LLM response generation work together:
128114

129-
```
130-
┌───────────────┐ ┌───────────────────────┐ ┌───────────────┐
131-
│ │ │ │ │ │
132-
│ User Query │────▶│ memory() Retrieval │────▶│ use_llm() │────▶ Response
133-
│ │ │ │ │ │
134-
└───────────────┘ └───────────────────────┘ └───────────────┘
135-
(Finds relevant memories) (Generates natural
136-
language answer)
137-
```
115+
```mermaid
116+
flowchart LR
117+
UserQuery["User Query"] --> MemoryRetrieval["memory() Retrieval<br>(Finds relevant memories)"]
118+
MemoryRetrieval --> UseLLM["use_llm()<br>(Generates natural<br>language answer)"]
119+
UseLLM --> Response["Response"]
120+
```
138121

139122
This chaining allows the agent to:
140123
1. First retrieve memories that are semantically relevant to the user's query

docs/examples/python/meta_tooling.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ agent = Agent(
3636
system_prompt=TOOL_BUILDER_SYSTEM_PROMPT, tools=[load_tool, shell, editor]
3737
)
3838
```
39-
- `editor`: Tool used to write code directly to a file named `"custom_tool_X.py"`, where "X" is the index of the tool being created.
39+
40+
- `editor`: Tool used to write code directly to a file named `"custom_tool_X.py"`, where "X" is the index of the tool being created.
4041
- `load_tool`: Tool used to load the tool so the Agent can use it.
4142
- `shell`: Tool used to execute the tool.
4243

docs/examples/python/multi_agent_example/multi_agent_example.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def math_assistant(query: str) -> str:
109109
except Exception as e:
110110
return f"Error processing your mathematical query: {str(e)}"
111111
```
112-
**Each specialized agent has a distinct system prompt, and tools in its inventory, and follows this general pattern.
112+
Each specialized agent has a distinct system prompt, and tools in its inventory, and follows this general pattern.
113+
113114
- [Language Assistant](https://github.com/strands-agents/docs/blob/main/docs/examples/python/multi_agent_example/language_assistant.py) specializes in queries related to translation into different languages.
114115
- [Computer Scince Assistant](https://github.com/strands-agents/docs/blob/main/docs/examples/python/multi_agent_example/computer_science_assistant.py) specializes in queries related to writing, editing, running, code and explaining computer science concepts.
115116
- [English Assistant](https://github.com/strands-agents/docs/blob/main/docs/examples/python/multi_agent_example/english_assistant.py) specializes in queries related to grammar, and english comprehension.

docs/user-guide/concepts/tools/example-tools-package.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,33 @@ pip install strands-agents-tools[mem0_memory]
5959
- [`stop`]({{ tools_repo }}/src/strands_tools/stop.py): Force stop the agent event loop
6060
- [`think`]({{ tools_repo }}/src/strands_tools/think.py): Perform deep thinking by creating parallel branches of agentic reasoning
6161
- [`use_llm`]({{ tools_repo }}/src/strands_tools/use_llm.py): Run a new AI event loop with custom prompts
62-
- [`workflow`]({{ tools_repo }}/src/strands_tools/workflow.py): Orchestrate sequenced workflows
62+
- [`workflow`]({{ tools_repo }}/src/strands_tools/workflow.py): Orchestrate sequenced workflows
63+
64+
65+
## Tool Consent and Bypassing
66+
67+
By default, certain tools that perform potentially sensitive operations (like file modifications, shell commands, or code execution) will prompt for user confirmation before executing. This safety feature ensures users maintain control over actions that could modify their system.
68+
69+
To bypass these confirmation prompts, you can set the `BYPASS_TOOL_CONSENT` environment variable:
70+
71+
```bash
72+
# Set this environment variable to bypass tool confirmation prompts
73+
export BYPASS_TOOL_CONSENT=true
74+
```
75+
76+
Setting the environment variable within Python:
77+
78+
```python
79+
import os
80+
81+
os.environ["BYPASS_TOOL_CONSENT"] = "true"
82+
```
83+
84+
When this variable is set to `true`, tools will execute without asking for confirmation. This is particularly useful for:
85+
86+
- Automated workflows where user interaction isn't possible
87+
- Development and testing environments
88+
- CI/CD pipelines
89+
- Situations where you've already validated the safety of operations
90+
91+
**Note:** Use this feature with caution in production environments, as it removes an important safety check.

0 commit comments

Comments
 (0)