{"id":32563107,"url":"https://github.com/dmis-lab/asguard","last_synced_at":"2026-07-10T11:31:49.464Z","repository":{"id":317347711,"uuid":"1066431181","full_name":"dmis-lab/ASGuard","owner":"dmis-lab","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-30T09:20:27.000Z","size":6165,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T02:57:16.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmis-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T13:27:38.000Z","updated_at":"2025-09-30T09:20:38.000Z","dependencies_parsed_at":"2025-09-30T11:40:43.805Z","dependency_job_id":null,"html_url":"https://github.com/dmis-lab/ASGuard","commit_stats":null,"previous_names":["dmis-lab/asguard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmis-lab/ASGuard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FASGuard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FASGuard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FASGuard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FASGuard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmis-lab","download_url":"https://codeload.github.com/dmis-lab/ASGuard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FASGuard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35330738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-29T02:56:33.327Z","updated_at":"2026-07-10T11:31:49.454Z","avatar_url":"https://github.com/dmis-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASGuard: Activation-Scaling Guard to Mitigate Targeted Jailbreaking Attack\n\n## Overview\nLarge language models (LLMs) often display brittle refusal behaviors that can be bypassed by simple linguistic variations, such as tense jailbreaking. ASGuard (Activation-Scaling Guard) introduces a mechanistically-informed framework to address this vulnerability with precision and interpretability.    \n(1) Circuit Analysis: Identifies attention heads causally linked to tense-based jailbreaking.    \n(2) Activation Scaling: Learns channel-wise scaling vectors to recalibrate vulnerable heads.    \n(3) Preventative Fine-Tuning: Reinforces robust refusal mechanisms while preserving model utility.    \nEvaluated across multiple LLMs, ASGuard achieves a Pareto-optimal tradeoff between safety and general capabilities, effectively reducing attack success rates while minimizing over-refusal. This work highlights how mechanistic insights can be translated into practical, efficient, and targeted safety interventions, advancing reliable and interpretable AI alignment.\n\n![](assets/overview_1.png)\n\n## Installation\nTo ensure compatibiliity with other libraries, we recommend using the folliwng versions. You can adjust it based on your environments:\n\n- Python \u003e= 3.10.14\n- CUDA 12.2\n\nFollow the order of installation.\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/dmis-lab/ASGuard.git\n   cd ASGuard\n   ```\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Implementation\n### Step 1: Circuit Analysis\n⚠️ Currently we do not support circuit construction. Please wait for an update.\n\n### Step 2: Activation Scaling\n\n```bash\nbash run_scaling.sh\n```\n\n### Step 3: Preventative Fine-Tuning\n\n```bash\nbash run_prevent.sh\n```\n\n## Evaluation\n⚠️ Currently we do not support evaluation. Please wait for an update.\n\n### Contact\nFor any questions or issues, feel free to reach out to [522yein (at) korea.ac.kr].","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fasguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmis-lab%2Fasguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fasguard/lists"}