Skip to content

[SECURITY] nginx, disk cleanup, cert renewal and security-update tools bypass AUTO_APPLY approval #89

Closed

Description

@OkiriGabriel

Problem

With AUTO_APPLY=false, several new tools that change hosts still run without human approval.

  • apply_nginx_config and restart_nginx (agent/core.py#L1570-L1582) have no dry_run and no approval step. They write files under /etc/nginx/ and reload or restart nginx immediately.
  • cleanup_stale_logs, install_log_cleanup_cron, renew_certificates and apply_security_updates are only gated by a dry_run argument, and the model chooses that value (inputs.get("dry_run", True)). If the model passes dry_run=false, the action runs live even with AUTO_APPLY=false.
  • NginxTools._run, DiskCleanup._run and SecurityUpdates._run call SafeExecutor().run(), which bypasses classification ("bypassing safety for internal approved calls"). These calls aren't approved; they come straight from the model.

The model's tool arguments can be steered by alert text and logs (prompt injection), so the AUTO_APPLY switch isn't actually enforced for these tools.

Expected

When AUTO_APPLY=false, every tool that changes a host returns requires_approval with an approval payload, the same way SafeExecutor.run_safe does. The model's dry_run choice should only be able to make a call safer, never less safe.

Suggested fix

  • In execute_tool, force dry_run=True for these tools unless self.auto_apply is true.
  • Give apply_nginx_config/restart_nginx the approval flow (or run_safe) when AUTO_APPLY=false.
  • Add tests: with AUTO_APPLY=false, dry_run=false and a recording runner, no mutating command is executed.

Related: #70 (emergency stop coverage).

Activity

  1. added
    bug
    security
    on Oct 19, 2026
  2. added a commit that references this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions