Package com.tnsai.quality.security.llm
Enum Class ContextFileSource
- All Implemented Interfaces:
Serializable,Comparable<ContextFileSource>,Constable
Tag identifying which kind of project-context file a scan operated on.
Used by
PromptInjectionDetector.detectInProjectContext(String, ContextFileSource)
for audit-log attribution and per-source policy decisions.
The framework's project-context loader walks up from the working directory looking for any of these files and feeds their contents into the agent's system prompt. A repo containing an adversarial context file is therefore a clean prompt-injection vector — every agent spun up in that directory ingests the malicious bytes automatically.
Detection scoping considerations:
TNSAI_MD/CLAUDE_MD/AGENTS_MDare known agent-instruction surfaces — strict scanning, fail closed on any high-confidence hit.README_MDis auto-loaded by some adapters — the rendered view is what the user sees, so hidden-instruction scans are especially relevant here.OTHERcatches custom file conventions; the calling loader still wants the same scan but the audit log gets a useful tag.
- Since:
- 0.8.4
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAGENTS.md/.agents.md— generic agent-instruction file.CLAUDE.md— Anthropic Claude Code project-context convention.Any other project-scoped file passed through the loader.README.md— repo-level documentation, sometimes auto-ingested..tnsai.md— TnsAI's own project-context convention. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContextFileSourceReturns the enum constant of this class with the specified name.static ContextFileSource[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
TNSAI_MD
.tnsai.md— TnsAI's own project-context convention. -
CLAUDE_MD
CLAUDE.md— Anthropic Claude Code project-context convention. -
AGENTS_MD
AGENTS.md/.agents.md— generic agent-instruction file. -
README_MD
README.md— repo-level documentation, sometimes auto-ingested. -
OTHER
Any other project-scoped file passed through the loader.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-