reskSecure
A Python package that intercepts at the logits level during LLM generation, using a 64-bit permission bitmask to define the operations a user or process may perform, implementing a bitmask-based LLM firewall to prevent jailbreak attacks and unauthorized tool calls.
Timeline (last 90 days)
reskSecure enforces the allowlist at the boundary, at a point earlier than when tool definitions are handed to the model, rejecting everything outside that set, so the model cannot see tools it has no right to call.
Having only an allowlist without seeing denial records is like being blind; having only logs without enforcement is nothing but a diary—neither alone is enough.
reskSecure uses a policy.yaml file to define policies, mapping capability bitmasks to phrase rules and tool permissions, and supports hard mode and bias mode.
reskSecure provides the BitmaskLogitsProcessor class, used to instantiate within the generation pipeline, passing in the user mask, model name, tokenizer, policy set, and device, intercepting each token prediction and applying policy rules.
In hard mode, the token logit matching a violating phrase is set to -inf, so the model cannot generate any part of that phrase at all, and if part has already been generated, it is forcibly ended with EOS.
In bias mode, reskSecure applies a negative penalty value (such as -5.0) to tokens matching violating phrases, reducing but not eliminating the probability of the violating phrase appearing.
reskSecure is a Python package that intercepts during the token prediction stage, blocking or penalizing violating phrases before they appear, and uses a 64-bit permission bitmask to define what a user or process may do.
Hugging Face's generate interface supports intervening on logits through the logits_processor parameter, and reskSecure uses this mechanism to block or suppress violating phrases before token sampling.
In the example policy of reskSecure, the mask 7 (binary 111) indicates possession of three capabilities, bits 0, 1, and 2, corresponding to the read_email, send_email, and read_sql tool permissions respectively.
reskSecure intercepts in the middle of the generation process, so violating content never appears in the output stream at all, making it more timely and more thorough than post-hoc scanning.
3 more timeline events
All Facts (13)
reskSecure enforces the allowlist at the boundary, at a point earlier than when tool definitions are handed to the model, rejecting everything outside that set, so the model cannot see tools it has no right to call.
50%UnverifiedHaving only an allowlist without seeing denial records is like being blind; having only logs without enforcement is nothing but a diary—neither alone is enough.
50%UnverifiedreskSecure uses a policy.yaml file to define policies, mapping capability bitmasks to phrase rules and tool permissions, and supports hard mode and bias mode.
50%UnverifiedreskSecure provides the BitmaskLogitsProcessor class, used to instantiate within the generation pipeline, passing in the user mask, model name, tokenizer, policy set, and device, intercepting each token prediction and applying policy rules.
50%UnverifiedIn hard mode, the token logit matching a violating phrase is set to -inf, so the model cannot generate any part of that phrase at all, and if part has already been generated, it is forcibly ended with EOS.
50%UnverifiedIn bias mode, reskSecure applies a negative penalty value (such as -5.0) to tokens matching violating phrases, reducing but not eliminating the probability of the violating phrase appearing.
50%UnverifiedreskSecure is a Python package that intercepts during the token prediction stage, blocking or penalizing violating phrases before they appear, and uses a 64-bit permission bitmask to define what a user or process may do.
50%UnverifiedHugging Face's generate interface supports intervening on logits through the logits_processor parameter, and reskSecure uses this mechanism to block or suppress violating phrases before token sampling.
50%UnverifiedIn the example policy of reskSecure, the mask 7 (binary 111) indicates possession of three capabilities, bits 0, 1, and 2, corresponding to the read_email, send_email, and read_sql tool permissions respectively.
50%UnverifiedreskSecure intercepts in the middle of the generation process, so violating content never appears in the output stream at all, making it more timely and more thorough than post-hoc scanning.
50%UnverifiedIn strict mode, if a prohibited phrase is partially matched, reskSecure forces generation to terminate with EOS.
50%UnverifiedreskSecure's verify_tool_action function is used to validate tool calls after generation, checking against the bitmask whether the required bits are set in the user mask, and rejecting them if not.
50%UnverifiedreskSecure is installed via pip install resksecure, and it installs the dependency resklogits for GPU-accelerated pattern matching.
50%