Skip to content

Harden prompt context by excluding README and AGENTS#60

Open
ganesh47 wants to merge 1 commit intomainfrom
codex/propose-fix-for-prompt-injection-vulnerability
Open

Harden prompt context by excluding README and AGENTS#60
ganesh47 wants to merge 1 commit intomainfrom
codex/propose-fix-for-prompt-injection-vulnerability

Conversation

@ganesh47
Copy link
Copy Markdown
Owner

Motivation

  • Prevent attacker-controlled root docs from being automatically embedded in LLM prompts by removing README.md and AGENTS.md from the default repository-context candidate list.

Description

  • Remove "AGENTS.md" and "README.md" from REPOSITORY_CONTEXT_CANDIDATES in src/prompt.ts so only curated project documents are considered for prompt context.
  • Add assertions to test/prompt.test.ts to verify the workflow prompt does not contain README excerpts and that the context reports Reference files: none when only README.md exists.

Testing

  • Ran npm test -- test/prompt.test.ts and the test file passed successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant