Skip to content

⚠️ SECURITY-#24: Gate EnvTool behind confirmation - #34

Merged
FernandoCelmer merged 4 commits into
masterfrom
feature/24
Aug 15, 2026
Merged

⚠️ SECURITY-#24: Gate EnvTool behind confirmation#34
FernandoCelmer merged 4 commits into
masterfrom
feature/24

Conversation

@FernandoCelmer

@FernandoCelmer FernandoCelmer commented Aug 15, 2026

Copy link
Copy Markdown
Member

Description

Gates EnvTool behind user confirmation (issue #24). Adds dangerous = True and a preview() method that names the variable being read or warns that all variable names will be listed. This brings environment variable access into the same confirmation gate as bash, write_file, and delete_file.

Motivation and Context

Closes #24. EnvTool had no dangerous flag, allowing the agent to silently enumerate all environment variable names and probe individual values with no user-visible confirmation. The only existing guardrail was value masking, which does not prevent disclosure of secret variable names.

Types of changes

  • Bug fix
  • New feature
  • Documentation

Checklist

  • Self-review done
  • Tests added
  • CHANGELOG updated
  • Docs updated

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding dangerous = True and a preview() to EnvTool is the right call — it brings env inspection behind the same confirmation gate as bash, write_file, and delete_file. Tests are precise. One inaccuracy in the preview message found below.

Comment thread pycodeloop/tools/env.py
@FernandoCelmer FernandoCelmer added the enhancement New feature or request label Aug 15, 2026
…closes

preview() said "list every variable name" for the no-argument case,
but run() without a name returns every NAME=value pair (values
masked, not omitted) — misleading a user approving the confirmation
prompt into thinking only names would be exposed.
@FernandoCelmer
FernandoCelmer merged commit dc266a8 into master Aug 15, 2026
8 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/24 branch August 15, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EnvTool exposes unmasked sensitive values when queried by exact name

1 participant