Adversarial input validation for agent-generated commands
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 461
- Forks
- 277
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 95
Description
Summary
AI agents make different mistakes than humans — they may generate inputs containing path traversal sequences, embedded query parameters, URL encoding, or control characters. The CLI should validate and reject malformed inputs at the CLI boundary before they reach the Kubernetes API.
Proposal
- Implement path canonicalization and sandbox validation for file arguments
- Reject resource IDs containing query params (
?,#) or URL encoding (%) - Filter non-printable ASCII control characters from all inputs
- Add
--sanitizeflag for defensive filtering of API responses (prompt injection defense)
Acceptance Criteria
- File path arguments are canonicalized and validated against path traversal
- Resource names/IDs reject
?,#,%-encoded characters - Control characters (non-printable ASCII) stripped from inputs
-
--sanitizeflag available to sanitize API response content
Context
Part of #2849 — making tkn agent-friendly.
/kind feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named; start by tracing the CLI argument boundary and the path from parsed inputs to the Kubernetes API, then locate API response handling for the proposed --sanitize flag. Done means the listed path, resource-ID, control-character, and response-sanitization acceptance criteria are covered without allowing malformed input through.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100