Huashu Design
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
A LoRA adapter for Llama-3.1-8B-Instruct that trains it to follow trusted instructions and ignore commands hidden in external data. A prompt injection defense for people building LLM apps.
LocalAlign_llama3.1_8B is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install torch "transformers>=4.51.0,<5" "peft==0.14.0" accelerate
LocalAlign is a fine-tuning method that makes a model resist prompt injection, where text inside a document or tool result tries to give the model new orders. The files here form a small add-on, a LoRA adapter, that sits on top of the Llama-3.1-8B-Instruct model. The defense is learned in training, so no separate attack detector runs at inference.
It suits developers who build apps where a model reads outside content, such as documents, web pages or tool output, and who need it to keep following only trusted instructions.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software | LLM app developers | Add a prompt injection defense to a model that reads outside data | A summarizer that must ignore commands inside a page |
| Security | AI security researchers | Study defenses and test them against injection attacks | Comparing attack success rates with and without the adapter |
| Agents | Agent builders | Keep a tool-using model from obeying commands in tool results | An agent that reads emails without following hidden orders |
| Research | Alignment researchers | Reproduce the paper's results with the released adapter | Checking the reported numbers on the listed benchmarks |
You can skip it if your app never feeds untrusted text to the model, or if you use a different base model, since this adapter is for Llama-3.1-8B-Instruct.
| Use case | Who | What they get back |
|---|---|---|
| Harden a model against injection | App developers | A model that treats data commands as untrusted |
| Test injection attacks | Security teams | Attack success rates to compare |
| Reproduce the paper | Researchers | The adapter behind the reported tables |
pip install torch "transformers>=4.51.0,<5" "peft==0.14.0" accelerate
pip install -U huggingface_hub hf download yuyangGong/LocalAlign_llama3.1_8B
You load the base Llama model, attach this adapter, and then prompt the model as usual. Trusted instructions go in the instruction part and outside content goes in the data part. The card's input format section is not part of the text shown here.
A person builds a summarizer that reads a web page. The page hides a line telling the model to reveal its instructions. With the adapter attached, the model summarizes the page and does not follow that line. The card reports lower attack success rates on its test sets.
If you are new to this, picture the model as an assistant that sometimes obeys notes slipped into the papers it reads. This adapter trains it to obey only its owner's instructions. Try it on a short document with a planted command.
If you know the field, the method has three stages: a warm-up preference for trusted instructions, generation of near-target adversarial examples, and margin-aware alignment that presses harder on small-margin examples. Adaptive attacks stay harder, and some benchmark scores drop slightly.
| Defense | HotpotQA attack rate | Qasper attack rate | InjecAgent attack rate |
|---|---|---|---|
| No defense | 74.0% | 83.0% | 81.1% |
| Meta-SecAlign | 44.0% | 45.0% | 13.5% |
| LocalAlign | 8.0% | 7.0% | 0.0% |
A LoRA adapter for Llama-3.1-8B-Instruct that trains it to follow trusted instructions and ignore commands hidden in external data. A prompt injection defense for people building LLM apps.
Made by yuyangGong on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: LocalAlign is a fine-tuning method that makes a model resist prompt injection, where text inside a document or tool result tries to give the model new orders. The files here form a small add-on, a LoRA adapter, that sits on top of the Llama-3.1-8B-Instruct model. The defense is learned in training, so no separate attack detector runs at inference.
Who it suits: It suits developers who build apps where a model reads outside content, such as documents, web pages or tool output, and who need it to keep following only trusted instructions.
Industry | Who uses it | How they use it | Example
Software | LLM app developers | Add a prompt injection defense to a model that reads outside data | A summarizer that must ignore commands inside a page
Security | AI security researchers | Study defenses and test them against injection attacks | Comparing attack success rates with and without the adapter
Agents | Agent builders | Keep a tool-using model from obeying commands in tool results | An agent that reads emails without following hidden orders
Research | Alignment researchers | Reproduce the paper's results with the released adapter | Checking the reported numbers on the listed benchmarks
You can skip it if your app never feeds untrusted text to the model, or if you use a different base model, since this adapter is for Llama-3.1-8B-Instruct.
Where to use it:
Use case | Who | What they get back
Harden a model against injection | App developers | A model that treats data commands as untrusted
Test injection attacks | Security teams | Attack success rates to compare
Reproduce the paper | Researchers | The adapter behind the reported tables
How to set it up:
pip install torch "transformers>=4.51.0,<5" "peft==0.14.0" accelerate
pip install -U huggingface_hub
hf download yuyangGong/LocalAlign_llama3.1_8B
How to use it: You load the base Llama model, attach this adapter, and then prompt the model as usual. Trusted instructions go in the instruction part and outside content goes in the data part. The card's input format section is not part of the text shown here.
Example: A person builds a summarizer that reads a web page. The page hides a line telling the model to reveal its instructions. With the adapter attached, the model summarizes the page and does not follow that line. The card reports lower attack success rates on its test sets.
For newcomers and experts: If you are new to this, picture the model as an assistant that sometimes obeys notes slipped into the papers it reads. This adapter trains it to obey only its owner's instructions. Try it on a short document with a planted command.
If you know the field, the method has three stages: a warm-up preference for trusted instructions, generation of near-target adversarial examples, and margin-aware alignment that presses harder on small-margin examples. Adaptive attacks stay harder, and some benchmark scores drop slightly.
Warm up a preference for trusted instructions
Generate near-target injected examples
Align with margin-aware weighting
Release a LoRA adapter
Attach it to Llama-3.1-8B-Instruct
Good to know:
Defense | HotpotQA attack rate | Qasper attack rate | InjecAgent attack rate
No defense | 74.0% | 83.0% | 81.1%
Meta-SecAlign | 44.0% | 45.0% | 13.5%
LocalAlign | 8.0% | 7.0% | 0.0%
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download yuyangGong/LocalAlign_llama3.1_8B
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 5 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| LocalAlign_llama3.1_8B This page | 156 | 9 | — | llama3.1 | |
| Qwen3-4B P9 HoneypotShares prompt-injection · peft · lora | 33 | 3 | — | apache-2.0 | |
| K2-Horizon-7B-UnoShares peft · lora · text-generation | 203 | 113 | — | apache-2.0 | |
| Kev-4BShares peft · lora · safetensors | 12,499 | 175 | — | apache-2.0 | |
| Bespoke-Nimble-9BShares peft · lora · safetensors | 1,027 | 254 | — | apache-2.0 | |
| Qwen3.8-27b-Terse-Coder-LoRAShares peft · lora · safetensors | 244 | 6 | 117M | apache-2.0 |
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.
alibaba · Kit
Reviews Git changes with an AI agent that reads files and searches the codebase, then writes comments tied to exact lines. It suits developers who want automat…