Updated Jul 15, 2026

Utilities

Fail the run when file contents miss a rule

Check a file's values against conditions and exit with a matching code.

Agent

overview

What assert-tool does

assert-tool is control flow between stages: read --in-file, test values, and exit non-zero when required conditions fail so later nodes never run on bad input.

Reach for it after discovery when empty hosts, missing markers, or unexpected shapes should abort before an expensive scanner starts.

Named inputs are --match (all/any), --regex, --from-string, --from-file, and --delimiter. Trickest provides it as a managed Utilities node that writes FILE and FOLDER alongside the exit status.

use cases

Where assert-tool fits

Stop a workflow when results are empty

Assert that a discovery node's output file contains at least the values you expect, and exit non-zero so the pipeline halts instead of feeding nothing forward.

Confirm an expected value is present

Match earlier-stage output against a known string or pattern to verify the right host, finding, or marker showed up before continuing.

Branch on any-versus-all logic

Set --match all to require every condition, or any to pass on a single hit, so one node expresses either strict or loose gates.

Match on patterns, not just literals

Use --regex to assert that values fit a shape, such as a status code range or a URL pattern, rather than a fixed string.

reference

assert-tool inputs and flags

6 inputs
NameTypeFlagDescription
matchSTRING--matchmatch mode [all/any] (default: `all`)
regexSTRING--regexuse regex to match values
in-fileFILE--in-filefile to read
delimiterSTRING--delimiterdelimiter for multiple `--from-string` values (default: `,`)
from-fileFILE--from-filematch from file
from-stringSTRING--from-stringmatch from string

Showing key inputs. assert-tool exposes 6 inputs in total.

example

Run assert-tool

assert-tool · command
# assert-tool: fail the run unless live hosts were foundassert_tool --in-file live.txt --regex '.+' 
sample output
assert-tool: checking live.txtrule: regex .+lines: 12matched: 12status: okexit: 0

guidance

Choosing assert-tool

Use assert-tool to turn file contents into a pass or fail decision inside a workflow. It gates; it does not filter. Prefer gf or fgrep-by-string when you need to select lines rather than halt the run.

fgrep-by-string

Filters lines by a fixed string. Use it to select values; use assert-tool to decide pass or fail on them.

gf

Pattern-based grep wrapper for selecting matches. assert-tool turns match outcomes into an exit code.

anew

Appends only new lines and signals novelty. A different gate: change detection, not condition checks.

faq

assert-tool questions

It exits with a code that reflects whether the conditions held, so the pipeline can stop or branch on the result.

Run assert-tool yourself

A results file feeds assert-tool, which checks it against your conditions and exits pass or fail so the workflow knows whether to continue.

Facts on this page come from the live Trickest tool library.