Package io.github.jbastgen.stemma.app.ai
Class PromptGuard
java.lang.Object
io.github.jbastgen.stemma.app.ai.PromptGuard
What stands between the repository and an AI service: text that goes out is cleaned of obvious secrets and cut to
the configured size, and files that must never be sent can be recognised. This is a safety net, not a guarantee:
it finds the usual token formats and
password = … lines, not every secret there is.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe outgoing text and what was done to it. -
Method Summary
Modifier and TypeMethodDescriptionstatic PromptGuard.GuardedCleanstext(ifredact) and cuts it tomaxChars.static booleanbinary(byte[] content) Binary content is never sent.static booleanWhether a file must not be sent: its path or its name matches one of the glob patterns (*any characters except/,**any characters,?one character; a pattern without/is compared with the file name only).
-
Method Details
-
apply
Cleanstext(ifredact) and cuts it tomaxChars. -
excluded
Whether a file must not be sent: its path or its name matches one of the glob patterns (*any characters except/,**any characters,?one character; a pattern without/is compared with the file name only). Case-insensitive. -
binary
public static boolean binary(byte[] content) Binary content is never sent.
-