Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop encoding.payloads accumulating each load #780

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

leondz
Copy link
Owner

@leondz leondz commented Jul 5, 2024

resolves #747

payload library length wasn't reset, leading to prompt accumulation

@leondz leondz added bug Something isn't working probes Content & activity of LLM probes labels Jul 5, 2024
Comment on lines +32 to +42
def test_encoding_payload_library_size_count():
garak.probes.encoding._load_payloads()
payload_count = len(garak.probes.encoding.payloads)
p = garak.probes.encoding.InjectBase2048()
assert len(garak.probes.encoding.payloads) == payload_count
p = garak.probes.encoding.InjectZalgo()
assert len(garak.probes.encoding.payloads) == payload_count
p = garak.probes.encoding.InjectBase64()
assert len(garak.probes.encoding.payloads) == payload_count
garak.probes.encoding._load_payloads()
assert len(garak.probes.encoding.payloads) == payload_count
Copy link
Collaborator

@jmartin-tech jmartin-tech Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test passes on main if calling the current load_payloads(), I suspect the test needs some more context on how to produce an accumulation of payloads during execution.

@leondz leondz merged commit 1ea2aeb into main Jul 18, 2024
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2024
@leondz leondz deleted the bugfix/encoding_payload_explosion branch August 15, 2024 15:04
@leondz leondz restored the bugfix/encoding_payload_explosion branch August 15, 2024 15:04
@leondz leondz deleted the bugfix/encoding_payload_explosion branch August 15, 2024 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working probes Content & activity of LLM probes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InjectZalgo sometimes has very high prompt counts
2 participants