aitrail keeps a record of how AI tools are used in a research project, phase by phase, while the work happens. From that record it audits gaps in human oversight, checks references, and writes the disclosure statement that journals, funders and universities increasingly ask for.
The package does not call any AI model and does not try to detect AI-generated text.
1. Start a log
The log is a folder, ai-log/, at the root of the
project. Each record is a small JSON file, so it can be versioned with
git alongside the code, data and manuscript.
project <- file.path(tempdir(), "open-data-survey")
ait_init(project, title = "Attitudes to open data among early-career researchers")Prompts often contain unpublished data or personal data, so by
default only a fingerprint of each prompt is stored
(prompt_store = "hash"). Storing prompts in full is a
deliberate choice.
2. Register tools and uses
Register each tool once, with the model and version when known: model behaviour changes between versions, and the version is what makes a use reproducible.
gpt <- ait_tool("ChatGPT", provider = "OpenAI", model = "GPT-4o",
version = "2024-08-06", access = "web", path = project)Then record each use: the phase of the project, the task, why AI was used, and how much of its output was kept.
screen <- ait_register_use(
phase = "literature_review",
task = "Summarise 60 abstracts for first-pass screening",
tool = gpt,
purpose = "Speed up title and abstract screening",
output_used = "partial",
person = "A. Researcher",
date = "2026-02-10",
path = project
)The phases come from a fixed vocabulary, with labels in English and Spanish:
ait_vocabulary("phases")[, c("id", "en")]
#> id en
#> 1 literature_review Literature review
#> 2 conceptualisation Conceptualisation
#> 3 study_design Study design
#> 4 data_collection Data collection
#> 5 data_processing Data processing
#> 6 analysis Analysis and code
#> 7 interpretation Interpretation
#> 8 writing Writing
#> 9 translation_editing Translation and editing
#> 10 figures Figures and visualisation
#> 11 peer_review Peer review
#> 12 communication Communication3. Record interactions and verifications
Interactions are optional and follow the privacy policy:
ait_log_interaction(screen,
prompt = "Summarise each abstract in two sentences: ...",
summary = "60 two-sentence summaries",
path = project)
#> [1] "int-3d61b8f498"Verifications record human oversight: who checked the output, how, and what happened.
ait_verify(screen, method = "source_check", outcome = "modified",
verifier = "A. Researcher",
notes = "7 of 60 summaries corrected against the abstracts",
path = project)
#> [1] "ver-77e2e4f8a3"4. Audit the log
The rest of this vignette uses the example project included in the package, a fictitious study in which some uses were deliberately left unverified.
project <- ait_example()
ait_log(project)
#> <ait_log: Attitudes to open data among early-career researchers (synthetic example)>
#> Tools: 3
#> Uses: 5
#> Interactions: 2
#> Verifications: 4
#> Phases: Literature review; Analysis and code; Writing; Translation and editing
#> Prompt storage: hashait_audit() applies documented rules and lists each
finding. It does not compute a score.
ait_audit(project)
#> <ait_audit: 5 uses, 5 finding(s)>
#> R01 [warn] Not verified: Suggest further studies on data-sharing attitudes (Literature review)
#> R02 [warn] Substantial use without expert review: Draft R code for the ordinal regression models (Analysis and code)
#> R03 [info] DeepL has no model or version recorded
#> R03 [info] Claude has no version recorded
#> R04 [warn] Literature review used AI, but no reference check is recorded; run ait_check_references(path = ...)
ait_audit_rules()
#> rule severity
#> 1 R01 warn
#> 2 R02 warn
#> 3 R03 info
#> 4 R04 warn
#> 5 R05 warn
#> 6 R06 warn
#> 7 R07 warn
#> 8 R08 warn
#> 9 R09 warn
#> description
#> 1 A use has no recorded verification.
#> 2 AI output was used substantially in analysis, interpretation or writing without an expert review.
#> 3 A tool has no model or version recorded.
#> 4 AI was used in the literature review, but no reference check is recorded.
#> 5 AI was used in peer review, which many journals and funders do not allow.
#> 6 Prompts are stored in full although the project's policy is not to.
#> 7 A prompt stored in full may contain personal data.
#> 8 A use refers to a tool that is not in the log.
#> 9 A verification or interaction refers to a use that is not in the log.5. Check references
Language models can invent references or attach a real DOI to the
wrong paper. ait_check_references() looks each one up in
Crossref and DataCite and compares the title, year and first author. It
accepts DOIs, citation strings, a BibTeX file or a data frame. With
path, the check is saved in the log and rule R04 is
satisfied.
ait_check_references("references.bib", path = project, mailto = "you@university.edu")A reference that is not_found is not proof of invention:
some DOIs are registered with agencies other than Crossref and DataCite.
Flagged references are for a person to check.
6. Disclose
The disclosure is generated from the log, in English or Spanish. Review it and adapt it to the policy of the journal or funder.
ait_disclosure(project)
#> AI tools (ChatGPT (OpenAI, GPT-4o, 2024-08-06), Claude (Anthropic, Claude Sonnet 4) and DeepL (DeepL SE)) were used in the following phases of this work: literature review; analysis and code; writing; translation and editing. 4 of the 5 recorded uses were verified by the research team (expert review, checked against sources and analysis rerun). AI output was used substantially in: analysis and code; translation and editing. The authors take full responsibility for the content of this work; AI tools are not listed as authors.
ait_disclosure(project, lang = "es")
#> Se utilizaron herramientas de IA (ChatGPT (OpenAI, GPT-4o, 2024-08-06), Claude (Anthropic, Claude Sonnet 4) y DeepL (DeepL SE)) en las siguientes fases de este trabajo: revisión bibliográfica; análisis y código; redacción; traducción y edición. El equipo de investigación verificó 4 de los 5 usos registrados (revisión experta, contraste con las fuentes y repetición del análisis). El resultado de la IA se utilizó de forma sustancial en: análisis y código; traducción y edición. Los autores asumen la plena responsabilidad del contenido de este trabajo; las herramientas de IA no figuran como autoras.style = "full" gives an appendix with every tool and
use, and style = "json" a machine-readable summary.
7. Report
ait_report() writes a self-contained HTML report with
the statement, tools, uses, verifications, reference checks and audit
findings, for supervisors, co-authors, ethics committees or editors.
ait_report(project, "ai-use-report.html")