60,670 stars. 18,911 forks. 404 commits. MIT. Latest tagged release v1.7.3, two days ago.
MadsLorentzen/ai-job-search is a job-application framework built on Claude Code: /scrape hunts job boards, /apply drafts a tailored CV and cover letter in LaTeX, /interview builds you a prep pack, /outcome logs what happened. The author is a geophysicist who was laid off in late 2025, ran the workflow on his own search, sent sixty-nine tailored applications, got twenty first interviews, and signed a contract as an AI engineer in June 2026.
That funnel is the hook. What I actually opened the repo for was the other half of it.
The threat model, stated honestly
SECURITY.md in this repo is one of the more candid threat models I’ve read on GitHub, and it opens by refusing the easy answer:
This is an agentic workflow: an LLM with file access reads untrusted web content (job postings) alongside your personal data (CV, profile, application history). That combination is the main risk surface, and it cannot be fully eliminated — only narrowed. A posting can carry hidden text written to steer the agent.
The posting is the risk surface. Not the CV, not the LaTeX, not the LaTeX compiler. Someone else’s HTML, which you fetch, which the model reads next to the thing you most want kept private, which the model is then allowed to write to files and shell out from.
The repo answers on two levels. Instruction-level: /apply, /rank, /scrape and /interview are told to treat posting text as data and never as direction, and never to fetch URLs found inside a posting body — the user-supplied URL is the sole exception. Reviewer research starts from the company identity the user confirmed, never from a link embedded in the ad.
Permission-level: every grant is enumerated in a table with a lifetime column and a guard column. That table is the most interesting artifact in the repo. Here’s the shape of it:
.claude/settings.jsonpermissions.allow— each shipped portal CLI by exact path (Bash(bun run .agents/skills/jobindex-search/cli/src/cli.ts:*)), plussalary_lookup.py,rank_state.py,job_key.py,verify_pdf.py,verify_layout.py,robots_check.py,fetch_page.py,pdftotext. Session-long.permissions.ask— always prompts, even over an allow rule or a skill grant: edits tosettings.json, to any.claude/skills/*/SKILL.md, to any.claude/commands/*.md, to.claude/agents/**, to.github/**, totools/security_guards.py. Andgit push.permissions.deny— blocked in every mode includingbypassPermissions:curl/wgetwith data, form, or upload flags;scp,sftp,ssh,nc/ncat; reads of.env,.env.*,~/.ssh/**,~/.aws/**,~/.gnupg/**— and the doc notes the Read denies also covercat/head/tail/sedrun through Bash.- Subagents (
posting-fetcher,posting-scorer,application-reviewer) — Read, Glob/Grep, WebFetch, WebSearch, Bash. Never Edit, never Write, never Agent. - Portal-skill
allowed-tools— exactly that portal’s owncli/src/cli.ts. Checked by path, so a skill granting another portal’s CLI, or a glob, fails CI. - Hooks: none. The template ships zero hooks, and any hook fails CI.
That last row is the one that made me stop reading. The stated reason: a hook runs with no prompt the moment its event fires, and that is the vector the Shai-Hulud worm used in August 2026. So this repo’s answer to “how do we make agent behavior reliable” is remove the surface that fires without asking.
And the LaTeX line is quietly excellent: compiling is deliberately not pre-approved, because a lualatex:* grant would also approve -shell-escape. In default mode each compile prompts, and the doc warns you not to click “don’t ask again,” because that persists exactly that rule to settings.local.json.
The guard: deterministic scrubbing before Step 1
tools/posting_guard.py runs on every posting before /apply Step 1 — URL-fetched or pasted — and inside every /rank scorer, and again on the archived posting in /interview.
Its docstring explains the design choice in a sentence most security tooling never gets to:
Removal is the defense: hidden content never reaches the cleaned text the workflow reads.
So it isn’t a detector that warns you. It rewrites. Concretely, it:
- Strips hidden HTML —
display:none,visibility:hidden,opacity:0(with a lookahead soopacity: 0.5survives),font-size:0in any unit,color:transparent,clip:rect(0,clip-path:inset(100%, off-screen positioning at four-digit negative offsets, thehiddenattribute,aria-hidden. Comments andscript/style/noscript/svg/templateblocks go too, but they’re scanned and not listed, because every real page has them. - Strips invisible characters — zero-width set, bidi controls, soft hyphen, BOM — and counts them, flagging the ones that indicate tampering: a zero-width character inside a word, or a bidi override/isolate. That’s the discriminator. Zero-width joiners are normal in emoji and Indic text; zero-width inside an English word is not.
- Quotes instruction-shaped lines rather than deleting them, because an SSH-administrator posting legitimately says “SSH” and deleting it would mangle the ad.
- Lists URLs that exist only inside hidden content.
- Lists words that mix Latin with Cyrillic or Greek letters — look-alike spoofing, the
ghоstwaretrick.
The verdict line prints a ⚠ only for signals that indicate targeting — instruction-shaped lines, tampering characters, mixed-script words. Hidden blocks and hidden URLs are reported as context, because navigation chrome is hidden on nearly every real page. And it advises; it never blocks. The user decides.
The archival discipline is the part I like most: the archive written to documents/applications/<company>_<role>/ keeps counts only, never the removed excerpts. The full excerpts go to the terminal. So the thing you hand to an employer, or sync to Notion later, doesn’t carry the payload along with it.
There are 67 test files under tests/. test_posting_guard.py is 23 KB. test_posting_gate_wiring.py exists to pin where the gate is invoked — not just that it works, but that it’s wired into /apply Step 0 and each scorer’s path, so a refactor can’t quietly remove the call.
The guard on the guard: CI fails the PR
tools/security_guards.py is the other half. Five checks, stdlib only, exit 1 with a failure list:
- Every
permissions.allowentry must be in the exactALLOWED_PERMISSIONSset. A PR that wants a new portal CLI adds it in the same diff — so the diff shows both. Catches permission widening likeBash(*)orBash(curl:*)landing on every fork at once. .gitignoremust still carry the personal-data ignore rules, and no non-allowlisted!patternnegation may re-include them.- No npm/bun lifecycle scripts (
preinstall,install,postinstall,prepare,prepack) and notrustedDependenciesin any.agents/**/package.json— becausebun installrunning code is the supply-chain hole, andtools/install_portal_clis.pyindependently skips any manifest carrying one. - Every
allowed-toolsentry in everySKILL.mdand everycommands/*.mdmust be inALLOWED_SKILL_TOOLS. Frontmatter is a second permission allowlist — Claude Code pre-approves it for the invoking turn, regardless of workspace trust. - Every
.claude/agents/*.mdmust declaretools:, and every entry must be inALLOWED_AGENT_TOOLS, which has no Edit, Write, NotebookEdit, or Agent. A missing key means every tool.
Check 5’s comment is worth quoting because it’s a real mechanics detail: tools: is tool-name granularity, so Bash(pattern) in an agent definition resolves to plain Bash — the scoping has to happen in settings.json, not in the agent frontmatter. So a patterned entry there is rejected as misleading, not merely broad.
The repo’s own framing: “These guards make the dangerous changes LOUD, not impossible.” That’s the correct posture for a template that 18,911 people forked.
What the honest limits section says
SECURITY.md has a “What this does not do” heading, and it’s the strongest part of the file:
- Not a sandbox. Claude Code’s Bash sandbox doesn’t run on native Windows at all, and on macOS and Linux it’s off by default. Turning it on in user settings is called out as the single strongest addition available, and nothing in the repo conflicts with it.
- Prefix rules are tripwires, not walls.
Bash(curl -d:*)matches a command that starts that way;curl -sS -ddoesn’t match it. The deny list catches obvious shapes and makes the rest require deliberate evasion — described as a different bar from prevention. - WebFetch is unrestricted by domain. Company research needs it, and a GET to an arbitrary host can carry data in the URL. The instruction-level rule is what stands between a hidden link and a fetch; the permission layer does not.
/rankscorers still hold rubric and posting in one context. The agent definition removes Edit, Write, and unscoped shell. Fully separating fetch from scoring would route every posting through the orchestrator, which/rankis explicitly built to avoid — so the compromise is named as a compromise.- The gate is deterministic, not an oracle. It catches payload classes that leave a trace. “A manipulation written to read naturally to a human and an agent alike leaves none.”
The part I didn’t expect: the PDF loop
Security is the memorable half, but /apply is an engineering artifact in a second register, and it’s the half I’d actually borrow.
The insight: LaTeX compiles fine and produces garbage. Job titles orphan to the next page. Cover letters spill onto page 2. Bullet fonts silently fall back to the body font. So the workflow compiles and reads the rendered pages, then iterates on the source with \needspace, \enlargethispage, and font-matching wrappers until the CV is exactly 2 pages with no orphaned entry titles and the cover letter is exactly 1 page with the signature visible. tools/verify_layout.py measures a compiled PDF for holes, orphans, and footer collisions; tools/verify_pdf.py checks page count and extractable text.
Then the ATS pass, which is the part I hadn’t considered being a real problem: an applicant-tracking system reads the PDF’s embedded text layer, not the rendered page — and LaTeX can silently emit PDFs whose text extracts as garbage, icon glyphs where the email address should be, interleaved lines from multi-column layouts. So it extracts with pdftotext (or BSD-licensed pypdf, no Poppler needed), verifies contact details appear as literal text, checks reading order, and scores the posting’s keyword coverage against what a parser actually sees. Honesty rule enforced in the same step: a keyword the profile genuinely supports gets added; a genuine gap stays visible as a gap, never stuffed.
And the CV-cutting policy, when it overflows two pages, refuses the mechanical approach. It scores each candidate line by (a) relevance to the target posting, (b) uniqueness in the document, (c) whether the cover letter depends on it — and cuts the lowest total first. An older-role bullet that hits the posting’s keywords survives ahead of a recent-role bullet that doesn’t.
The drafter-reviewer separation is the other load-bearing bit: a second agent, spawned with a fresh context, researches the company and critiques the drafts; the drafter then revises. One pass leaves missed keywords and generic phrasing; a critic that never saw the drafter’s reasoning catches both.
Scoring is five dimensions with published weights — Technical Skills 30%, Experience Match 25%, Behavioral/Culture 15%, Career Alignment 30%, with Location as pass/fail rather than weighted. Bands: 75+ strong fit, 60–74 apply and address gaps in the letter, 45–59 discuss, 30–44 skip unless strategic, below 30 skip. Two hard gates run before any of it: an Eligibility Gate (citizenship / PR requirement = FAIL, don’t score, don’t draft) and a Language Gate that hard-rejects a posting requiring a language not on your table at all, but flags rather than rejects when a declared language’s stated bar reads higher than your declared level — because “fluent” varies enormously by company and geography, and a borderline case should get your judgment rather than a silent drop.
Numbers worth stealing
- Repo languages by bytes: Python 758,790 · TypeScript 425,159 · TeX 13,349.
- Six contributors; the author has 117 commits, second place 70, third 37. It’s one person’s project with a community around it, not a foundation project.
- Eight releases since Aug 3, 2026 — v1.3.0 through v1.7.3, roughly weekly.
framework_versionmarkers on the methodology files tell a fork maintainer which of their personalized files a release touched;tools/check_upstream_updates.pypreviews the per-file diffs before you merge. - ~67 test files, several large:
test_rank_state.pyis 41 KB,test_rank_command.py33 KB,test_security_guards.py36 KB,test_apply_records_application.py29 KB. - CI runs six-plus legs: skill lint, security guards, the Python matrix, a Windows leg added after #480 and #486 shipped Windows-only failures with every Linux leg green, dependency review, and a LaTeX smoke matrix that compiles the example CV with
lualatexand the cover letter withxelatexthen verifies extractable text. - The changelog entry I liked best is a query-operator fix with real measurements: freehire’s search parses an uppercase
ORbetween up to five alternatives, nothing told the agent, so “Go or Rust” became two merged-by-hand searches. Measured live —golangreturns 3,550,golang OR rustreturns 6,805. The CLI already passed-qthrough unchanged; the fix was documentation.
The decision I’d want to argue about
The repo’s extension model has three points — portal skills, document templates, evaluation criteria — and every one of them is designed so you never touch upstream. Portal skills are auto-discovered folders under .agents/skills/ following a contract: a search/detail CLI, --format json|table|plain output, an enabled: flag in its SKILL.md, its own tests. /add-portal investigates a job board (search-URL pattern, result structure, robots.txt), scaffolds a skill to that contract, and test-runs a live query before registering anything. Auth-walled portals get declined; restrictive terms get a prominent personal-use-only warning baked into the generated skill.
But borrowing a portal skill from another fork is deliberately manual. The README tells you to read all of the code first, verify the only network calls go to the board it claims, check package.json has no dependencies and no lifecycle scripts, then run its tests offline. And then it explains why, which is the sentence I keep coming back to:
The copy step is manual on purpose. Your settings already allow installed portal skills to run without asking each time — so an installer that fetched them from third-party repos for you would skip the one check that matters: you, reading the code first. There isn’t one, and that’s a security decision rather than a missing feature.
That’s the difference between shipping an installer and shipping a capability. An installer is the more useful feature and the one most 18,911 forks would have taken. The author decided the review was load-bearing, and put the reasoning in the README where someone wanting the shortcut would find it.
Where I’d push: the whole posture is narrowing, not prevention, and it depends on Claude Code’s permission model being as narrow as documented. The Windows sandbox gap is real — on windows-latest there is no Bash sandbox at all, and the repo’s own CI runs its Python suite under Git Bash on Windows. If the permission layer is weaker there, the gate in posting_guard.py is carrying more weight than the doc’s framing admits.
I haven’t run this workflow. 60K stars and a signed contract are not a security audit, and a repo that ships SECURITY.md with a “what this does not do” section deserves to be read as the author wrote it — which is to say, with the holes listed, not assumed absent.
References
MadsLorentzen/ai-job-search— the repo,SECURITY.md,tools/posting_guard.py,tools/security_guards.py,.claude/settings.json,.claude/skills/job-application-assistant/04-job-evaluation.md- Community forks & portal index — discussion #78
- The author is a geophysicist; the 69-application funnel is on his LinkedIn
Comments
Powered by GitHub Discussions via Giscus. Sign in with GitHub to leave a comment.