guarded / echo

echo - cli-mcp examples/composition-with-guard

NAME

echo - echo a message (audited, argv-validated)

SYNOPSIS

echo

DESCRIPTION

Echoes the first positional arg back to the caller after passing through verb.Wrap. MCP tool name echo. Input schema: args (string array).

Examples:

# accepted - simple input
guarded echo hello
# hello

# accepted - whitespace in argv is fine
guarded echo "hello world"
# hello world

# rejected by policy.ValidateArg
guarded echo 'hello; rm -rf /'
# policy: shell metacharacter rejected: arg positional[0] contains ';' at index 5
# audit row records: verb=echo, exit=2 (PolicyDenied)

# MCP form via mcporter
mcporter call guarded.echo --args '{"args":["hello"]}'
# hello

The audit row produced on every call (passing or rejected) lets a later auditor reconstruct what the agent attempted, not just what succeeded. Tail $TMPDIR/cli-mcp-composition.jsonl with jq to see the wire shape.

Usage:

echo [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]