Skip to main content
POST /v1/agents/runtime/{runtime_id}/files/find Walks a directory tree inside the runtime and returns the files, and the individual lines, that match. The search executes natively in the guest agent: no shell is invoked and no find, grep or ripgrep process is spawned, so there is nothing to quote, escape or sanitise and no command injection surface. Supply glob to choose which files are considered, pattern to match their contents, or both together.

Parameters

Response

Behaviour notes

  • Literal by default. Without regex, the pattern is matched as plain text, so a.b does not match axb and no escaping is required for user supplied input.
  • Binary files are skipped. A file whose first 8 KiB contains a NUL byte, or which is not valid UTF-8, is not searched.
  • Large files are skipped. Files above 8 MiB are excluded, keeping a search over a build tree bounded.
  • Directory symlinks are never followed. The walk uses lstat semantics, so symlink cycles cannot hang the search and a link cannot be used to escape path.
  • Bounded work. The walk stops at 200000 files regardless of max_results, and the compiled regular expression is size limited, so a pathological pattern cannot exhaust guest memory.
  • Glob matching applies to the name and the full path. *.py matches app.py at any depth; src/*.py matches by relative path.