Skip to content

EXEC-001: Agent must execute Python as script files, never python -c #70

@tbitcs

Description

@tbitcs

Problem

AI agents (Oz/Warp) were executing long Python computations via python -c "...", which:

  • Cannot be interrupted cleanly — Ctrl-C / abort does not stop the computation
  • Does not stream output — caller blocks until process exits or times out
  • Silently fails on Windows CMD/PowerShell for long inline strings
  • Makes debugging and logging impossible
  • Creates unresponsive sessions that must be force-killed

Rule Added

Added hard rule H14 to AGENTS.md in Glossa Lab:

  • H14.1: python -c is absolutely forbidden for any non-trivial command
  • H14.2: Required pattern: create_file + shell.cmd python <file.py>
  • H14.3: Single-line import/version checks are the only exception

Specsmith Recommendation

Codify as universal specsmith governance rule EXEC-001:

An AI agent must never run non-trivial Python code via python -c.
It must write the code to a file first and then execute the file.
This ensures the process can be interrupted, output streams correctly, and debugging is possible.

Affected Projects

  • Glossa Lab (primary — where violation was discovered 2026-04-15)
  • Any specsmith-governed project where an AI agent executes Python

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions