Skip to content
Back to search

ai-text-detector-github

Detect whether a passage shows AI-like writing signals and return an explainable risk estimate with confidence, caveats, and next steps.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/lynote-ai/ai-text-detector with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/lynote-ai/ai-text-detector'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lynote-ai-ai-text-detector/badge.svg)](/listings/lynote-ai-ai-text-detector)

HTML

<a href="/listings/lynote-ai-ai-text-detector"><img src="/api/listings/lynote-ai-ai-text-detector/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

pip install -e .
ai-detect examples/sample_ai_like.txt --json

Or bootstrap a local environment:

bash scripts/setup.sh

Example output:

Conclusion: AI-like signals are present, but this medium-confidence score is a risk estimate rather than proof.
Score: 84/100
Confidence: medium
Verdict: high_ai_likelihood
Words analyzed: 256

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 106 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. ---
  2. name: ai-text-detector-github
  3. description: Detect whether a passage shows AI-like writing signals and return an explainable risk estimate with confidence, caveats, and next steps.
  4. ---
  5. # AI Text Detector Skill
  6. ## Overview
  7. This skill wraps the local `ai-detector-skill` analyzer into a reusable open source Codex-style skill.
  8. It is designed for:
  9. - essays
  10. - emails
  11. - articles
  12. - reviews
  13. - forum posts
  14. - other prose where a user asks whether the writing may be AI-generated
  15. This skill returns a risk estimate, not proof of authorship.
  16. ## Trigger Conditions
  17. Use this skill when:
  18. - the user asks "is this AI-written?"
  19. - the user asks to detect AI-generated text
  20. - the user pastes a passage and asks whether it sounds machine-written
  21. - the user wants a cautious AI-likeness review for a document or message
  22. ## Required Behavior
  23. - Never present the score as proof.
  24. - Never accuse a named person of cheating, fraud, or misconduct.
  25. - Ask for a longer sample when the text is under about 80 words.
  26. - Prefer "AI-like signals are present" over "This was written by AI".
  27. - For high-stakes contexts, recommend human review and comparison with known writing samples.
  28. ## Execution Flow
  29. 1. Receive the candidate text and check length.
  30. 2. If the sample is under about 80 words, explain that the detector will be noisy and ask for a longer sample when possible.
  31. 3. Save the text to a file or pipe it through stdin.
  32. 4. Run the local detector:
  33. ```bash
  34. ai-detect path/to/text.txt --json
  35. ```
  36. or:
  37. ```bash
  38. python -m aidetect.cli path/to/text.txt --json
  39. ```
  40. or from the repository helper:
  41. ```bash
  42. python scripts/detect.py path/to/text.txt --json
  43. ```
  44. 5. Parse the JSON result and validate that it includes:
  45. - `score`
  46. - `confidence`
  47. - `verdict`
  48. - `conclusion`
  49. - `signals`
  50. - `caveats`
  51. 6. Respond in this order:
  52. 1. One-sentence conclusion with uncertainty.
  53. 2. Score and confidence.
  54. 3. Strongest evidence signals.
  55. 4. Caveats.
  56. 5. Next steps only when useful.
  57. ## Output Guidance
  58. Good phrasing:
  59. - "AI-like signals are present, but this is not proof."
  60. - "The result is uncertain because the sample is short."
  61. - "This should be reviewed against known writing samples."
  62. Avoid:
  63. - "This was definitely written by AI."
  64. - "The detector proves misconduct."
  65. - Any accusation against a named person.
  66. ## Repository Layout
  67. - `SKILL.md`: skill contract and usage rules
  68. - `scripts/detect.py`: repository-local wrapper for the detector
  69. - `scripts/setup.sh`: local environment bootstrap
  70. - `references/api-reference.md`: response contract and CLI reference
  71. - `assets/templates/report.md`: reusable response template
  72. ## Development Notes
  73. - Keep the analyzer explainable and lightweight.
  74. - Prefer local heuristics over hidden network calls.
  75. - Update this file whenever behavior or output changes.
README.md · README · 379 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Lynote AI Text Detector
  2. <p align="center">
  3. <img src="assets/hero.png" alt="Lynote AI Text Detector" width="100%" />
  4. </p>
  5. <p align="center">
  6. <a href="https://github.com/lynote-ai/ai-text-detector/actions/workflows/ci.yml"><img src="https://github.com/lynote-ai/ai-text-detector/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
  7. <img src="https://img.shields.io/badge/python-3.9%2B-3776ab" alt="Python 3.9+" />
  8. <img src="https://img.shields.io/badge/license-MIT-16a34a" alt="MIT License" />
  9. </p>
  10. <p align="center">
  11. <strong>Detect AI-Generated Text at Document and Sentence Levels</strong>
  12. <br />
  13. Analyze writing patterns, identify potentially AI-generated sentences, and review content classified as human-written, AI-generated, or mixed.
  14. </p>
  15. <p align="center">
  16. <a href="./README-zh-CN.md">简体中文</a>
  17. ·
  18. <a href="#features">Features</a>
  19. ·
  20. <a href="#how-it-works">How It Works</a>
  21. ·
  22. <a href="#use-cases">Use Cases</a>
  23. ·
  24. <a href="#installation">Installation</a>
  25. </p>
  26. Lynote AI Text Detector is an AI-generated text detection project for analyzing essays, articles, academic writing, notes, transcripts, and other written content. Its production model is designed to examine text at two levels: the overall document and individual sentences.
  27. Rather than treating every document as entirely human-written or entirely AI-generated, the production model supports **Human**, **AI**, and **Mixed** document classifications, alongside sentence-level **Human**, **AI**, and **Paraphrased** classifications.
  28. The repository also includes a separate lightweight local analyzer for explainable, offline text-risk triage. The local analyzer and the production two-level model are different components; their capabilities and evaluation results should not be conflated.
  29. ## Features
  30. ### Document-Level AI Text Detection
  31. Analyze a complete document and classify its overall writing patterns. The production model supports:
  32. - **Human** — classified as human-written.
  33. - **AI** — classified as AI-generated.
  34. - **Mixed** — a document containing a combination of writing patterns.
  35. ### Sentence-Level AI Detection
  36. Go beyond a single document-level result. The production model also classifies individual sentences as:
  37. - **Human**
  38. - **AI**
  39. - **Paraphrased**
  40. Sentence-level results can help reviewers locate sections that warrant closer attention. They should be interpreted as model classifications, not proof of who wrote a sentence.
  41. ### Mixed-Content Analysis
  42. Real-world writing may combine original human writing, AI-generated passages, and edited or paraphrased material. The production model includes a `mixed` document class to represent this kind of content rather than forcing every document into a binary human-or-AI label.
  43. ### Explainable Local Analysis
  44. The lightweight local analyzer returns an AI-like writing risk estimate with supporting information:
  45. - Risk score from 0 to 100.
  46. - Verdict and confidence level.
  47. - Strongest weighted signals.
  48. - Caveats and limitations.
  49. - Suggested next steps when useful.
  50. This local analyzer is intended for cautious preliminary review. It is not the production two-level classifier.
  51. ### Multilingual Model Development
  52. The production pipeline is designed around multilingual backbones, including XLM-R and ModernBERT, with the current project documentation describing work focused on English, Chinese, Portuguese, and Spanish.
  53. ### Responsible Interpretation
  54. AI-text detection is inherently uncertain. Results should be treated as indicators for review, not definitive proof of authorship, misconduct, or intent. Short samples and high-stakes decisions require particular caution.
  55. ## How It Works
  56. The production detection pipeline uses a shared model backbone with two classification heads:
  57. 1. **Document head** — predicts a document-level class: `human`, `ai`, or `mixed`.
  58. 2. **Sentence head** — predicts sentence-level classes: `human`, `ai`, or `paraphrased`.
  59. The joint training objective combines document-level and sentence-level learning:
  60. `L = L_doc + α · L_sent`
  61. ```mermaid
  62. flowchart TD
  63. A[Input document] --> B[Text processing]
  64. B --> C[Shared model backbone]
  65. C --> D[Document-level head]
  66. C --> E[Sentence-level head]
  67. D --> F[Human / AI / Mixed]
  68. E --> G[Human / AI / Paraphrased]
  69. F --> H[Detection output]
  70. G --> H
  71. H --> I[Human review and interpretation]
  72. ```
  73. The repository contains both the production model pipeline and a lightweight local analyzer. See the [project structure](#project-structure) and the technical documentation for the distinction.
  74. ### Production Model Documentation
  75. - [Architecture](detection-model-pipeline/docs/ARCHITECTURE.md)
  76. - [Model methodology](detection-model-pipeline/docs/MODEL.md)
  77. - [Data construction](detection-model-pipeline/docs/DATA_CONSTRUCTION.md)
  78. - [API implementation notes](detection-model-pipeline/docs/API.md)
  79. ## Use Cases
  80. ### Teacher Triage
  81. A teacher receives a student essay or reflection and wants an initial signal before conducting a closer review.
  82. Suggested workflow:
  83. 1. Run the detector on the submitted text.
  84. 2. Review the available document-level result and, where supported, sentence-level classifications.
  85. 3. Consider the result alongside the student's previous writing and other relevant context.
  86. Detection results should never be treated as proof of academic misconduct.
  87. ### Editorial Review
  88. An editor wants to review articles, product descriptions, guest posts, or other submitted content for writing patterns that may deserve closer attention.
  89. Why it fits:
  90. - Longer-form prose provides more context for review than very short snippets.
  91. - Explainable signals can help editors decide which passages to examine.
  92. - Human editorial judgment remains essential.
  93. ### Trust and Safety Queueing
  94. A moderation team wants to prioritize suspicious long-form posts for manual review rather than automatically removing content.
  95. Why it fits:
  96. - Detection signals can support review prioritization.
  97. - Document-level and sentence-level results can provide different views of the same text.
  98. - Final moderation decisions remain with human reviewers.
  99. ### Internal Content Quality Review
  100. A team wants to review human-written and AI-assisted drafts and identify passages that may need additional editing.
  101. Why it fits:
  102. - Detection results can be used as one signal during content review.
  103. - Sentence-level analysis can help locate specific passages for closer examination.
  104. - Results should be interpreted in context, not as definitive authorship claims.
  105. ## Detection Results: Two Different Components
  106. This repository includes two distinct detection components. Their outputs should not be treated as interchangeable.
  107. ### Production Two-Level Model
  108. The production pipeline is designed to provide:
  109. | Analysis level | Supported classifications |
  110. |---|---|
  111. | Document | `human`, `ai`, `mixed` |
  112. | Sentence | `human`, `ai`, `paraphrased` |
  113. The pipeline includes data preparation, training, calibration, evaluation, and serving code. The repository documentation does not make a general production-accuracy claim.
  114. ### Lightweight Local Analyzer
  115. The local analyzer provides a separate risk estimate and evidence signals. Its verdict values are:
  116. - `insufficient_text`
  117. - `low_ai_likelihood`
  118. - `mixed_or_uncertain`
  119. - `high_ai_likelihood`
  120. Example output:
  121. ```text
  122. Conclusion: AI-like signals are present, but this medium-confidence score is a risk estimate rather than proof.
  123. Score: 84/100
  124. Confidence: medium
  125. Verdict: high_ai_likelihood
  126. Words analyzed: 256
  127. ```
  128. The example illustrates the local analyzer's output format; it is not a claim about expected accuracy or production-model output.
  129. ## Installation
  130. The lightweight local analyzer can be installed and run with Python.
  131. ### Requirements
  132. - Python 3.9 or later.
  133. ### Install
  134. ```bash
  135. git clone https://github.com/lynote-ai/ai-text-detector.git
  136. cd ai-text-detector
  137. pip install -e .
  138. ```
  139. Alternatively, initialize a local environment with:
  140. ```bash
  141. bash scripts/setup.sh
  142. ```
  143. ### Run Detection
  144. Analyze a text file:
  145. ```bash
  146. ai-detect examples/sample_ai_like.txt
  147. ```
  148. Return JSON:
  149. ```bash
  150. ai-detect examples/sample_ai_like.txt --json
  151. ```
  152. Read text from standard input:
  153. ```bash
  154. cat essay.txt | ai-detect --json
  155. ```
  156. ## Python Usage
  157. The lightweight local analyzer can also be called from Python:
  158. ```python
  159. from aidetect import analyze_text
  160. with open("essay.txt", encoding="utf-8") as file:
  161. text = file.read()
  162. result = analyze_text(text)
  163. print("Score:", result.score)
  164. print("Confidence:", result.confidence)
  165. print("Verdict:", result.verdict)
  166. for signal in result.strongest_signals():
  167. print(signal.name, signal.note)
  168. ```
  169. ## Evaluation
  170. The repository includes a reproducible evaluation of the **lightweight local analyzer** using the public [HC3 dataset](https://huggingface.co/datasets/Hello-SimpleAI/HC3).
  171. The documented evaluation uses the English `finance`, `medicine`, and `open_qa` subsets, taking the first 100 rows from each subset.
  172. ### Evaluation Snapshot
  173. | Metric | Result |
  174. |---|---:|
  175. | Human mean score | 5.4 |
  176. | AI mean score | 18.4 |
  177. | Mean separation | 13.0 points |
  178. | Human coverage | 0.427 |
  179. | AI coverage | 0.920 |
  180. | Covered accuracy at `score >= 45` | 0.317 |
  181. These results indicate that the local analyzer separates human and AI answers on average in this sample, but its measured covered accuracy is limited. It is better understood as a cautious triage and explanation tool than as a stand-alone authorship classifier.
  182. **Scope note:** These metrics apply only to the lightweight local analyzer on the documented HC3 sample. They are not benchmark results for the production two-level model.
  183. Read the [full HC3 evaluation report](docs/HC3_EVALUATION.md).
  184. Reproduce the evaluation:
  185. ```bash
  186. make eval-hc3
  187. ```
  188. ## Project Structure
  189. ```text
  190. ai-text-detector/
  191. ├── detection-model-pipeline/ # Production two-level model pipeline
  192. │ ├── code/ # Pipeline stages and validators
  193. │ ├── model_entity/ # Model components and backbones
  194. │ ├── data/demos/ # Synthetic demo data
  195. │ └── docs/ # Model and pipeline documentation
  196. ├── assets/ # Project images and diagrams
  197. ├── docs/ # Evaluation reports
  198. ├── examples/ # Example input text
  199. ├── references/ # Reference documentation
  200. ├── scripts/ # Local detection and evaluation scripts
  201. ├── src/aidetect/ # Lightweight local analyzer
  202. ├── tests/ # Tests
  203. ├── AGENTS.md
  204. ├── SKILL.md
  205. ├── README.md
  206. ├── README.zh-CN.md
  207. ├── pyproject.toml
  208. └── requirements.txt
  209. ```
  210. ## Developer Integration
  211. The primary focus of this project is AI-generated text detection. For local use, the repository provides a CLI and Python interface through the lightweight analyzer.
  212. For hosted integration into another application, see the optional [Lynote AI Detector API](https://lynote.ai/ai-detector-api). API access is an additional integration option, not the central purpose of this repository.
  213. Technical references:
  214. - [Pipeline API documentation](detection-model-pipeline/docs/API.md)
  215. - [Local reference documentation](references/api-reference.md)
  216. ## Development
  217. Run the test suite:
  218. ```bash
  219. make test
  220. ```
  221. Run the demo:
  222. ```bash
  223. make demo
  224. ```
  225. Run the benchmark:
  226. ```bash
  227. make benchmark
  228. ```
  229. Run the HC3 evaluation:
  230. ```bash
  231. make eval-hc3
  232. ```
  233. ### Continuous Integration
  234. GitHub Actions is configured to run tests on Python 3.9, 3.11, and 3.13, regenerate benchmark and HC3 evaluation reports, and upload the reports as workflow artifacts.
  235. ## Contributing
  236. Contributions are welcome. Useful areas include:
  237. - Document-level and sentence-level detection.
  238. - Multilingual detection.
  239. - Explainable detection signals.
  240. - Evaluation methodology and benchmark coverage.
  241. - Responsible interpretation and safer user guidance.
  242. See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
  243. ## Related Projects
  244. - [AI Humanize Text](https://github.com/lynote-ai/humanize-text)
  245. - [AI Image Detector](https://github.com/lynote-ai/ai-image-detector)
  246. - [AI Tutor](https://github.com/lynote-ai/ai-tutor)
  247. ## License
  248. MIT. See [LICENSE](LICENSE) for details.
  249. ---
  250. <p align="center">
  251. <strong>Lynote AI Text Detector</strong>
  252. <br />
  253. AI-generated text detection at document and sentence levels.
  254. </p>

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.