Skip to main content

Log Tail

@sntxrr/log-tailv2026.10.25.1· MIT· 1d agoBEHAVIORS
01README

Read the last lines of a log chosen by NAME from an allowlist fixed in the model definition, with secret values redacted. Built for an alert-triage agent that has no shell: an alert names a log, the cause is usually one line near its end, and the alternatives are a human tailing it for the agent or a general file-read tool that can read anything. The caller passes a name, never a path; the name-to-path map lives in the definition, where only its owner can change it. A name is matched with Object.hasOwn and a name that is not name-shaped is never echoed, because --input name=@file would otherwise turn a refusal into a read. The configured path must be absolute, normalised, a regular file, not a symlink and equal to its own realpath, and the opened file's device and inode must match the lstat taken before the open, so a symlink swapped in between is refused rather than followed. Output is capped at 200 lines. Redaction drops values and keeps names (password=[REDACTED]) across key=value, JSON, YAML, CLI flags, URL userinfo, Authorization headers and bare token shapes, and fails closed: a line mentioning a password manager CLI or a private key is withheld whole, a line still credential-shaped after redaction is withheld whole, and an error in redaction fails the method. Both methods are read-only.

02Behaviors1
@sntxrr/log-tail/allowlistv2026.10.25.1log_tail.ts

Global Arguments

ArgumentTypeDescription
logsrecordThe allowlist: log name → entry. Names are what callers pass; paths never are.
maxScanBytes?numberRead at most this many bytes from the end of a file. Bounds a filtered tail of a large log.
maxLineChars?numberCut each returned line to this many characters, after redaction.
fn tail(name: string, lines?: coerce.number)
Read-only. Return the last \`lines\` (1–${MAX_LINES}) lines of the allowlisted log \`name\`, with secret values redacted. Refuses unknown names, symlinks and paths that resolve elsewhere.
ArgumentTypeDescription
namestringAllowlisted log name. Not a path.
lines?coerce.number
fn list()
Read-only. List the allowlisted log names, with whether each is readable now, its size and its last-modified time. Reads no content.

Resources

tail(infinite)— The last lines of one allowlisted log, redacted, with counts of what was redacted or withheld.
list(infinite)— Every allowlisted name, whether it is readable now, its size and age. No content.
03Previous Versions1
2026.10.22.1MIT
04Stats
A
100 / 100
Downloads
6
Archive size
15.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
05Platforms
06Labels