magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
2 min read

filter-without-input

A deny rule by default: it refuses a filter or interpreter with no file, script, pipe or redirect, which reads a stdin nothing feeds, and names what to run instead.

What it catches

A filter or interpreter with no file, script, pipe or redirect, which reads a stdin nothing feeds.

Why

A filter given no input reads stdin, and under an agent harness stdin is the harness's own: where the harness holds it open, nothing writes to it and nothing closes it, so the call waits past the tool timeout and goes on waiting in the background. Name the input: a file operand, a pipe into the command, or a <, << or <<< redirect on it or on a loop or block around it. It reads each tool's own flag grammar, so grep -e pat file, jq --arg k v . f and head -n 5 file are fed, and tr, tee and xargs fire whenever nothing feeds them, because their operands are never input. python, node, perl, ruby and the shells fire given - or no script and no inline program, and a shell given -s: a python3 - whose heredoc sat on a later cat waited eight hours. read fires without -t or -u. A recursive grep with no path passes: GNU grep, macOS's BSD grep and the ugrep a host may put behind grep all search the working directory then. What the guard cannot classify passes, because it refuses only what it can prove: an unknown flag, an unquoted expansion that may split into several words, jq -n, an awk program with a BEGIN block, a command inside a function body. ripgrep with no path passes for the same reason: it searches the working directory unless stdin is a pipe or a file, which a hook cannot see.

Default and override

By default this rule takes the decision deny. A workspace sets it by name, in its root magusfile, to deny, advise or off:

magus\guard.builtins({"filter-without-input": "advise"})

A loosening takes effect once it is committed; a tightening applies at once.

Seeing it

A verdict names its rule in brackets, which is how you got here:

deny [filter-without-input]: ...

A workspace that sets this rule to advise sees advise [filter-without-input]: ... instead.

magus describe rule filter-without-input prints the same entry at a terminal, and magus describe rules lists every rule this workspace enforces.

See also

guardrulesfilter-without-inputdeny
Last updated (61fd39a7)
Earlier changes on this page (5)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. Workspace in full.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. Magusfile in full.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

Buzz

The language magusfiles are written in (the .buzz engine). Buzz in full.

CI

An ordinary target you compose yourself with ctx.needs; magus does not hardcode its stages. It is the anchor magus affected ci keys off, and ci strips the rw charm. CI in full.

Agent

A model working through an agent host such as Claude Code, Codex, Cursor or OpenCode. magus treats an agent as one more caller of its CLI, MCP tools and console, held to the same checks as a person. Agent in full.

Tool

An action a model can call through its host: a name, a description, a typed input and a result. magus serves its tools over MCP, each a read of the workspace model or a run of the CLI it already has. Tool in full.

Harness

The deterministic scaffolding around the work on a change, for a person or an agent: compiler errors, formatters, linters, checks, gates, leases and hooks, placed at points a person chose. Around an agent's loop, magus supplies one and keeps it outside. Harness in full.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate. Run in full.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.