@aiacta-org/ai-attribution-lint
v1.0.14
Published
CLI validator for ai-attribution.txt files. The AIACTA open standard for AI content attribution and publisher rights (AIACTA Proposal 4, §5.7)
Downloads
764
Maintainers
Readme
@aiacta-org/ai-attribution-lint
CLI validator for
ai-attribution.txtfiles. The AIACTA open standard for AI content attribution (Proposal 4, §5.7).
What is this?
@aiacta-org/ai-attribution-lint validates your ai-attribution.txt file — the plain-text file publishers place on their website to declare their preferences to AI systems. It checks syntax, required fields, valid values, SPDX licence identifiers, and webhook reachability.
Think of it as the eslint for the AIACTA standard.
Install
# Run once without installing (recommended for quick checks)
npx @aiacta-org/ai-attribution-lint https://yourdomain.com --json
# Install globally
npm install -g @aiacta-org/ai-attribution-lint
# Install as a dev dependency in a project
npm install --save-dev @aiacta-org/ai-attribution-lintUsage
Check a live website
npx @aiacta-org/ai-attribution-lint https://yourdomain.com --jsonThe linter automatically fetches /.well-known/ai-attribution.txt (and falls back to /ai-attribution.txt).
Check a local file
npx @aiacta-org/ai-attribution-lint ./ai-attribution.txtJSON output (for CI pipelines)
npx @aiacta-org/ai-attribution-lint https://yourdomain.com --jsonOutput format:
{
"errors": [],
"warnings": [
"Schema-Version is missing — defaults to 1.0"
],
"info": []
}Exit codes:
0— Passed (no errors)1— Failed (one or more errors, or warnings in--strictmode)2— Could not fetch or parse the file
Strict mode (treat warnings as errors)
npx @aiacta-org/ai-attribution-lint https://yourdomain.com --strictWhat it checks
| Rule | Severity |
|------|----------|
| Schema-Version is present and is "1.0" | Warning if missing |
| Contact field is present | Warning if missing |
| Allow-Purpose / Disallow-Purpose values are valid enum values (training, rag, index, quality-eval) | Error |
| Content-License is a valid SPDX identifier or All-Rights-Reserved | Error |
| Citation-Webhook URL is reachable (HTTP HEAD request) | Warning if unreachable |
| Reward-Tier is a valid enum value | Error |
| robots.txt conflicts with Allow-Purpose | Warning |
| Unknown fields are silently ignored (forward-compatibility per §5.6) | — |
Use in CI/CD
Add to your GitHub Actions workflow to validate your ai-attribution.txt on every deploy:
- name: Validate ai-attribution.txt
run: npx @aiacta-org/ai-attribution-lint https://yourdomain.com --jsonOr validate a local file during build:
- name: Validate ai-attribution.txt
run: npx @aiacta-org/ai-attribution-lint ./public/.well-known/ai-attribution.txtNode.js API
const { lint } = require('@aiacta-org/ai-attribution-lint');
const result = await lint('https://yourdomain.com');
// or: await lint('./ai-attribution.txt')
console.log(result.errors); // string[] — blocking issues
console.log(result.warnings); // string[] — advisory issues
console.log(result.info); // string[] — informational notes
if (result.errors.length > 0) {
process.exit(1);
}Example ai-attribution.txt
Schema-Version: 1.0
Contact: [email protected]
Preferred-Attribution: Your Publication Name (yourdomain.com)
Allow-Purpose: rag
Allow-Purpose: index
Disallow-Purpose: training
Require-Citation: true
Require-Source-Link: true
Citation-Format: title-and-url
Citation-Webhook: https://yourdomain.com/webhooks/ai-citations
Recrawl-After: 24h
Reward-Tier: standard
Content-License: All-Rights-ReservedPlace this file at https://yourdomain.com/.well-known/ai-attribution.txt.
Related packages
| Package | Purpose |
|---------|---------|
| @aiacta-org/ai-citation-sdk | Receive and verify citation webhook events |
| @aiacta-org/crawl-manifest-client | Query AI providers' crawl history for your domain |
License & Copyright
Copyright © 2026 Eric Michel, PhD. Licensed under the Apache License 2.0.
AIACTA™ is part of the AIACTA open standard.
