{"id":29961776,"url":"https://github.com/osu-nlp-group/webguard","last_synced_at":"2025-08-03T23:42:45.943Z","repository":{"id":306253298,"uuid":"1021134975","full_name":"OSU-NLP-Group/WebGuard","owner":"OSU-NLP-Group","description":"WebGuard: Building a Generalizable Guardrail for Web Agents","archived":false,"fork":false,"pushed_at":"2025-07-24T12:25:45.000Z","size":12931,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-24T16:57:29.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OSU-NLP-Group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-07-17T00:17:29.000Z","updated_at":"2025-07-24T12:25:49.000Z","dependencies_parsed_at":"2025-07-24T17:07:35.827Z","dependency_job_id":null,"html_url":"https://github.com/OSU-NLP-Group/WebGuard","commit_stats":null,"previous_names":["osu-nlp-group/webguard"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/OSU-NLP-Group/WebGuard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FWebGuard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FWebGuard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FWebGuard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FWebGuard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSU-NLP-Group","download_url":"https://codeload.github.com/OSU-NLP-Group/WebGuard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSU-NLP-Group%2FWebGuard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268629811,"owners_count":24281172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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-08-03T23:42:38.053Z","updated_at":"2025-08-03T23:42:45.689Z","avatar_url":"https://github.com/OSU-NLP-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebGuard\n\n[![GitHub Stars](https://img.shields.io/github/stars/OSU-NLP-Group/WebGuard?style=social\u0026label=WebGuard)](https://github.com/OSU-NLP-Group/WebGuard)\n[![arXiv](https://img.shields.io/badge/arXiv-2507.14293-b31b1b.svg)](https://arxiv.org/abs/2507.14293)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Dataset License: CC BY-NC 4.0](https://img.shields.io/badge/Dataset%20License-CC%20BY--NC%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc/4.0/)\n\u003ca href=\"https://huggingface.co/datasets/osunlp/WebGuard\"\u003e\u003cimg src=\"https://img.shields.io/badge/WebGuard -Dataset-blue.svg\" alt=\"WebGuard Benchmark\"\u003e\u003c/a\u003e\n\n**WebGuard** is a generalizable guardrail system for web agents that helps detect potentially harmful actions before they are executed. This repository contains the complete codebase, dataset, and annotation tools for the WebGuard research project.\n\n## 🚀 Overview\n\nWeb agents are becoming increasingly capable of performing complex tasks on websites, but this capability comes with significant safety risks. WebGuard addresses this challenge by providing:\n- **Large-Scale Dataset**: Large-scale annotated dataset for training and evaluation\n- **Annotation Tools**: Purpose-built tools for efficient data annotation\n- **Model for Proactive Safety Monitoring**: Detects potentially harmful actions before execution\n\n\n\n## 📊 Dataset\n\n### WebGuard Dataset\n\nThis dataset contains web safety annotations for browser interactions. Each entry represents an annotated action on a website with a risk level.\n\nFields:\n\n```bash\nurl: The URL where the action was performed\ndescription: Description of the action (may be null)\ntagHead: HTML tag type of the target element\nScreenshot: Google Drive link to screenshot view\nAnnotation: Review classification (SAFE/UNSAFE/LOW/HIGH)\nwebsite: Website name/category\n```\n\n\n## 🔧 Annotation Tool\n\nWe provide a specialized annotation tool built upon the WebOlympus Chrome Extension for efficient web safety annotation.\n\n### Getting Started\n\nFor complete installation instructions, usage guidelines, and annotation examples, please refer to:\n\n📖 **[Annotation Tool Guide](annotation_tool/annotation_tool_introduction.md)**\n\nThis comprehensive guide covers:\n- Chrome extension installation steps\n- Annotation interface walkthrough  \n- Safety labeling guidelines\n- Example annotations and best practices\n- Troubleshooting common issues\n\nThe tool source code is available at `annotation_tool/webguard_annotation_tool.zip`.\n\n\n\n## 🛠️ Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/OSU-NLP-Group/WebGuard.git\n   cd WebGuard\n   ```\n\n2. **Install dependencies of LLaMA-Factory**\n   ```bash\n   git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git\n   cd LLaMA-Factory\n   pip install -e \".[torch,metrics]\" --no-build-isolation\n   ```\n\n\n## 🏋️ Model Training\n\n### Data Preparation\n\nBefore training, convert the raw dataset to LLaMA-Factory format:\n\n```bash\n# Convert multimodal data\npython data_processing/multimodal_generata_factory_input_data.py\n```\n\n### Training Commands\n\n#### Text-Only Models\n\n**3B Model (Qwen2.5)**\n```bash\nllamafactory-cli train configs/3b_monitor_qwen2_5_a11y_full_sft_eval.yaml\n```\n\n**7B Model (Qwen2.5)**\n```bash\nllamafactory-cli train configs/7b_monitor_qwen2_5_a11y_full_sft_eval.yaml\n```\n\n#### Multimodal Models\n\n**3B Vision-Language Model**\n```bash\nllamafactory-cli train configs/3b_monitor_qwen2_5vl_full_sft_eval.yaml\n```\n\n**7B Vision-Language Model**\n```bash\nllamafactory-cli train configs/7b_monitor_qwen2_5vl_full_sft_eval.yaml\n```\n\n## ⚠️ Disclaimer\n\nThis code and dataset are released solely for research purposes, with the goal of making the web more accessible and safer through language technologies. The authors strongly discourage any potentially harmful use of the data or technology by any party.\n\n## 📄 License\n\n- **Code**: MIT License\n- **Dataset**: Creative Commons Attribution-NonCommercial 4.0 International\n\nSee [LICENSE](LICENSE) for full details.\n\n## 📖 Citation\n\nIf you find this work useful, please consider starring our repository and citing our papers:\n\n```bibtex\n@article{zheng2025webguard,\n  title={WebGuard: Building a Generalizable Guardrail for Web Agents},\n  author={Zheng, Boyuan and Liao, Zeyi and Salisbury, Scott and Liu, Zeyuan and Lin, Michael and Zheng, Qinyuan and Wang, Zifan and Deng, Xiang and Song, Dawn and Sun, Huan and others},\n  journal={arXiv preprint arXiv:2507.14293},\n  year={2025}\n}\n\n@inproceedings{zheng-etal-2024-webolympus,\n    title = \"{W}eb{O}lympus: An Open Platform for Web Agents on Live Websites\",\n    author = \"Zheng, Boyuan  and Gou, Boyu  and Salisbury, Scott  and Du, Zheng  and Sun, Huan  and Su, Yu\",\n    editor = \"Hernandez Farias, Delia Irazu  and Hope, Tom  and Li, Manling\",\n    booktitle = \"Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: System Demonstrations\",\n    month = nov,\n    year = \"2024\",\n    address = \"Miami, Florida, USA\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://aclanthology.org/2024.emnlp-demo.20\",\n    pages = \"187--197\",\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Fwebguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosu-nlp-group%2Fwebguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-nlp-group%2Fwebguard/lists"}