-
Notifications
You must be signed in to change notification settings - Fork 56
Document credential access in execute_bash tool #1005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3ef8b13
54f70fa
15a31d5
7b0374b
540aa8d
60d5b09
73ce7d0
40b77f7
6c630d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -117,6 +117,9 @@ def to_llm_content(self) -> Sequence[TextContent | ImageContent]: | |||||||
| ret += f"\n[Current working directory: {self.metadata.working_dir}]" | ||||||||
| if self.metadata.py_interpreter_path: | ||||||||
| ret += f"\n[Python interpreter: {self.metadata.py_interpreter_path}]" | ||||||||
| if self.metadata.available_secrets: | ||||||||
| secrets_list = ", ".join(f"${s}" for s in self.metadata.available_secrets) | ||||||||
| ret += f"\n[Available secrets: {secrets_list}]" | ||||||||
| if self.metadata.exit_code != -1: | ||||||||
| ret += f"\n[Command finished with exit code {self.metadata.exit_code}]" | ||||||||
| llm_content.append(TextContent(text=maybe_truncate(ret, MAX_CMD_OUTPUT_SIZE))) | ||||||||
|
|
@@ -213,6 +216,13 @@ def visualize(self) -> Text: | |||||||
| ### Output Handling | ||||||||
| * Output truncation: If the output exceeds a maximum length, it will be truncated before being returned. | ||||||||
|
|
||||||||
| ### Credential Access | ||||||||
| * Automatic secret injection: When you reference a registered secret key in your bash command, the secret value will be automatically exported as an environment variable before your command executes. | ||||||||
| * How to use secrets: Simply reference the secret key in your command (e.g., `echo ${GITHUB_TOKEN:0:8}` or `curl -H "Authorization: Bearer $API_KEY" https://api.example.com`). The system will detect the key name in your command text and export it as environment variable before it executes your command. | ||||||||
| * Secret detection: The system performs case-insensitive matching to find secret keys in your command text. If a registered secret key appears anywhere in your command, its value will be made available as an environment variable. | ||||||||
| * Security: Secret values are automatically masked in command output to prevent accidental exposure. You will see `<secret-hidden>` instead of the actual secret value in the output. | ||||||||
| * Refreshing expired secrets: Some secrets (like GITHUB_TOKEN) may be updated periodically or expire over time. If a secret stops working (e.g., authentication failures), try using it again in a new command - the system will automatically use the refreshed value. For example, if GITHUB_TOKEN was used in a git remote URL and later expired, you can update the remote URL with the current token: `git remote set-url origin https://${GITHUB_TOKEN}@github.com/username/repo.git` to pick up the refreshed token value. | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
OK! Looks good. Verbose, but these LLMs will deal with it. This is not always true, though: this happens on the Cloud, and I don't think, as of now, anywhere else in the project. So how about we add an escape hatch, maybe, for the LLM to not assume it will always happen?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. e.g. |
||||||||
|
|
||||||||
| ### Terminal Reset | ||||||||
| * Terminal reset: If the terminal becomes unresponsive, you can set the "reset" parameter to `true` to create a new terminal session. This will terminate the current session and start fresh. | ||||||||
| * Warning: Resetting the terminal will lose all previously set environment variables, working directory changes, and any running processes. Use this only when the terminal stops responding to commands. | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.