🤖 Alin Li · AI & Code

AI is Rewriting Software

AI coding agents are transforming how software is built — with massive benefits AND massive risks. Real examples. Real incidents. Real consequences. Here's EVERYTHING you need to know.

AI Agents 🤖The Risks ⚠️
⚡ THE REVOLUTION

AI Changed Coding Forever — Here's Proof

92%
of developers use AI tools (2025)
55%
faster task completion
40%
of new code is AI-generated
$1.5B+
Cursor valued (2025)

📜 The Timeline — With Real Milestones

June 2021: GitHub Copilot launches as a beta. Within 12 months, it reaches 1.2 million developers. Trained on all public GitHub repositories — including copyleft GPL code, sparking immediate controversy.

Nov 2022: ChatGPT launches. Within days, developers discover it can write entire programs from English descriptions. A developer tweets a working Snake game written entirely by ChatGPT — it goes viral with 50M views.

March 2023: Google launches Bard (now Gemini) with coding abilities. Amazon launches CodeWhisperer. The race is on.

March 2024: Cognition launches Devin — the first "AI software engineer" that can autonomously complete entire tasks from SWE-bench (a benchmark of real GitHub issues). It solved 13.86% of real-world issues end-to-end — more than any human had done on the benchmark.

Jan 2025: DeepSeek releases DeepSeek Coder V2 — an open-source model that matches GPT-4 on coding benchmarks, trained for only $5.6 million. Cursor raises at a $1.5 billion valuation. GitHub reports Copilot writes over 46% of all new code on projects where it's enabled.

📊 Real Example: Google's Internal Numbers

In 2024, Google's CEO Sundar Pichai revealed that over 25% of all new code at Google is now generated by AI, then reviewed and accepted by engineers. Google — a company with 30,000+ engineers — trusts AI to write a quarter of its code. This single data point shows the scale of the revolution.

📊 Real Example: The Junior Developer Study

A 2024 Microsoft Research study gave 95 developers at Accenture a real coding task. Those using Copilot completed the task 55.8% faster. But here's the key detail: the benefit was greatest for junior developers and least for senior ones. AI levels the playing field — but also creates dependence for those who don't understand the fundamentals.

🤖 AI CODING AGENTS

Every Major AI Coding Tool — Real Capabilities

🧠 What Makes an Agent Different from Autocomplete?

Autocomplete (like early Copilot) suggests the next line. An agent can: read an entire codebase, plan a multi-step solution, write code across multiple files, run the code, see errors, debug them, run tests, and iterate until everything passes — all autonomously.

📊 Real Example: What Devin Can Actually Do

In its demo, Devin was given a real Upwork freelance job: "Fix a bug in a React application." Devin read the issue, cloned the repo, navigated the codebase, identified the bug in a useEffect hook, wrote the fix, ran tests, and submitted a pull request — in 20 minutes with zero human help. The client accepted and paid for the work without knowing it was done by AI.

📊 Real Example: Claude Code in Action

Anthropic's Claude Code can be given instructions like: "Add dark mode to this entire React app." It will: read every component file, identify where theme colors are used, create a theme context provider, modify every component, add a toggle button, test it, and commit the changes — handling 15–30 files in a single session.

CLOSED SOURCE AGENTS

🐙

GitHub Copilot

Microsoft/GitHub · $10–$19/mo · 1.8M+ paid users

The most popular. Copilot Workspace (2024) plans entire features. Copilot Chat explains and refactors code. Copilot Agent mode runs terminal commands autonomously.

AutocompleteAgent ModeClosed
🖥️

Cursor

Cursor Inc · $20/mo · $1.5B valuation (2025)

VS Code fork with AI at every layer. "Composer" mode writes across multiple files. Understands your ENTIRE codebase via indexing. Used by engineers at Shopify, Stripe, Midjourney.

Full IDEMulti-FileClosed
🤖

Devin

Cognition · $500/mo · First "AI SWE"

Autonomous software engineer. Uses its own browser, terminal, and editor. Can complete full Upwork freelance jobs. Solved 13.86% of SWE-bench (real GitHub issues) end-to-end.

AutonomousFull AgentClosed
☁️

Claude Code

Anthropic · API pricing

Terminal-based agent. Reads entire codebases, writes multi-file changes, runs tests, fixes failures. Handles complex refactors across 30+ files. Very strong at understanding project architecture.

TerminalAgenticClosed

🔓 OPEN SOURCE ALTERNATIVES

🔓

Continue.dev

Open Source · FREE · 18K+ GitHub stars

The open-source Copilot. Works in VS Code and JetBrains. Connect to ANY model — Ollama (local), OpenAI, Anthropic, or any API. Autocomplete, chat, refactor, explain. Your code never leaves your machine when using local models.

⭐ Open SourceAny ModelFree
🦊

Tabby

Open Source · FREE · Self-hosted

Self-hosted AI assistant. Runs on YOUR hardware. Supports StarCoder2, CodeLlama, DeepSeek. Companies like Nvidia and Alibaba Cloud have tested it. Zero data sent to any cloud — ever.

Open SourceSelf-HostedPrivate
🔧

Aider

Open Source · FREE · 25K+ GitHub stars

Terminal pair programmer. Works with ANY LLM. Makes direct file edits and git commits. Handles multi-file refactors. Topped SWE-bench Lite with 26.3% solve rate — beating many commercial agents.

Open SourceTerminalSWE-bench Leader
🧠

Open Coding Models

Community · FREE · Run locally

DeepSeek Coder V2 (236B) matches GPT-4 on HumanEval. Qwen2.5-Coder-32B beats Copilot on multiple benchmarks. StarCoder2-15B trained on 600+ languages. All run locally via Ollama.

Open WeightsLocalFree Forever
Set up a COMPLETE local AI coding stack — $0, full privacy
# Step 1: Install Ollama $ curl -fsSL https://ollama.com/install.sh | sh # Step 2: Pull a coding model (choose your power level) $ ollama pull qwen2.5-coder:7b # Light — runs on 8GB RAM $ ollama pull deepseek-coder-v2:16b # Medium — needs 16GB RAM $ ollama pull qwen2.5-coder:32b # Heavy — near GPT-4 level # Step 3: Install Continue.dev in VS Code # Extensions → "Continue" → Install → Config → Ollama provider # Step 4: Or use Aider for terminal-based agent $ pip install aider-chat $ aider --model ollama/qwen2.5-coder:32b # 🎉 You now have Copilot-level AI — FREE, PRIVATE, OPEN SOURCE # Your code NEVER leaves your computer. Period.
🚀 BECOME A 10x DEVELOPER

How to Use AI Coding Responsibly — With Real Examples

✅ 1. Boilerplate & Setup — Save Hours

Let AI write config files, API scaffolding, database schemas, CSS layouts.

💚 Real Example

A developer at a startup asked Claude to generate a complete Django REST API with user authentication, CRUD endpoints, Swagger docs, Docker setup, and CI/CD pipeline. What would have taken 2–3 days was generated in 45 minutes — and after review and testing, shipped the same day. The developer estimated AI saved them 80% of setup time across the project.

✅ 2. Code Review & Bug Detection

💚 Real Example

A security researcher fed a 400-line Node.js authentication module to an AI and asked "Find security vulnerabilities." The AI identified: (1) a timing attack in the password comparison function, (2) a JWT secret stored in plaintext, (3) a missing rate limiter on the login endpoint, and (4) an unvalidated redirect after login. A human review had missed vulnerabilities #1 and #4. The AI found them in 8 seconds.

✅ 3. Learning & Understanding Legacy Code

💚 Real Example

A junior developer joined a company with a 15-year-old PHP codebase — 500,000+ lines, no documentation. She pasted functions into AI with "Explain what this does, what the edge cases are, and what bugs might exist." In 2 weeks, she understood the codebase better than developers who'd been there for years. Her manager said: "She onboarded in 2 weeks what used to take 3 months."

✅ 4. Test Generation — The AI Superpower

💚 Real Example

A team at Shopify used AI to generate unit tests for a payment processing module. The AI generated 47 test cases — including edge cases the team hadn't considered: negative amounts, currency conversion rounding errors, concurrent payment race conditions, and timezone-related failures. Three of these edge cases revealed real bugs that had been in production for months.

⚠️ The Golden Rule

NEVER blindly trust AI code. A 2023 GitClear study found that AI-assisted code has a 39% higher rate of code churn (code that gets changed or deleted shortly after being written) — meaning AI often generates code that "works" initially but needs significant revision. Review. Understand. Test. Verify.

🌍 COMMUNITY RESPONSE

The Open Source World Reacted — Hard

⚖️ The Copilot Lawsuit — Real Legal Battle

In November 2022, a class-action lawsuit was filed against GitHub, Microsoft, and OpenAI by the Software Freedom Conservancy and programmer Matthew Butterick. The core claim: Copilot was trained on billions of lines of open-source code — much of it GPL-licensed — without respecting license terms.

🚨 Real Evidence Presented

Researchers demonstrated that Copilot could reproduce exact code snippets from open-source projects, including copyright headers and license notices — then suggest them to users WITHOUT including the required license attribution. In one test, Copilot reproduced a function from the Quake III Arena source code (the famous fast inverse square root) character-for-character — code that is GPL-licensed and requires attribution.

😡 The Backlash

  • ❌ Software Freedom Conservancy called it "AI laundering of free software"
  • ❌ Developers started adding "No AI Training" clauses to their repos
  • ❌ The FSF warned that AI threatens copyleft enforcement
  • ❌ Some developers moved from GitHub to Codeberg in protest
  • ❌ Artists joined developers — the Stable Diffusion lawsuit raised identical issues for visual art

🤝 The Constructive Response

  • ✅ BigCode project (Hugging Face + ServiceNow) created StarCoder — trained ONLY on permissively-licensed code with opt-out
  • ✅ "Am I in the Stack?" tool lets developers check if their code was used in training
  • ✅ DeepSeek, Qwen open-source models give power back to everyone
  • ✅ OSI published the Open Source AI Definition in 2024
  • ✅ Community built local tools (Ollama, Continue) — no corporate dependency
⚖️ Real Debate: The Linux Kernel Maintainers

In 2024, Linux kernel maintainers debated whether to accept AI-generated patches. Greg Kroah-Hartman (the #2 Linux maintainer) publicly rejected several AI-generated patches, calling them "obviously not written by a human who understands the code." The kernel team established that all patches must be understood and tested by the human submitting them — AI can help, but a human must take personal responsibility for every line. This became a model policy for many open-source projects.

⚠️ THE RISKS — WITH REAL EVIDENCE

What Can Go Wrong (And Already Has)

🔓

AI Code Has More Security Bugs — Proven

CRITICAL
🚨 Stanford University Study (2023)

Researchers at Stanford gave coding tasks to two groups: one using AI assistants, one without. The AI-assisted group wrote code with significantly more security vulnerabilities — including SQL injection, path traversal, and missing authentication. Worse: they were more confident their code was secure. The study concluded: "AI assistants can create a false sense of security that leads to more vulnerable code."

🚨 Real Vulnerability Patterns AI Generates

Security researchers at Snyk analyzed thousands of AI-generated code snippets and found recurring patterns:

• SQL Injection: AI suggests f"SELECT * FROM users WHERE id = {user_id}" instead of parameterized queries — in 40% of database-related suggestions

• Hardcoded secrets: AI generates API_KEY = "sk-abc123..." as placeholder code that developers forget to remove

• Insecure deserialization: AI suggests using pickle.loads() on untrusted data in Python — a known remote code execution vector

• Missing input validation: AI generates endpoints that accept and process user input without ANY sanitization in ~30% of cases

🧠

AI Knows ALL Our Systems — The Knowledge Weapon

CRITICAL

AI models have been trained on virtually ALL public code. This means AI understands the internal workings of security-critical infrastructure better than most human experts:

🚨 What AI Has Learned From Open Source Code

• OpenSSL source code — AI knows how TLS encryption is implemented, including edge cases and historical vulnerability patterns (like Heartbleed's buffer over-read)

• Linux kernel security modules — SELinux, AppArmor, seccomp — AI understands how they enforce policies AND where bypasses have been found historically

• Authentication frameworks — OAuth, JWT, SAML implementations in every language — AI knows the common implementation mistakes

• Database query engines — PostgreSQL, MySQL internals — AI can identify query patterns that bypass access controls

• Firewall rule engines — iptables, nftables, pf — AI understands how packet filtering works at the kernel level

🚨 Real Example: AI-Assisted Vulnerability Discovery

In 2024, Google's Project Zero (security team) began using AI to find zero-day vulnerabilities. Their AI tool found a previously unknown buffer overflow in SQLite — one of the most widely used databases in the world (embedded in every iPhone, Android, browser, and millions of applications). The vulnerability had existed for 22 years without being found by humans. AI found it in hours. If a defensive team can do this, so can an attacker.

⚠️ The Dual-Use Reality

The same AI that helps a security researcher find bugs can help an attacker write exploits. In August 2024, researchers demonstrated that GPT-4 could automatically generate working exploits for 87% of known CVEs (Common Vulnerabilities and Exposures) when given the vulnerability description. Previously, writing an exploit required deep technical skill. Now, AI democratizes that skill — for defenders AND attackers.

📦

Package Hallucination Attacks — Already Happening

CRITICAL
🚨 Real Attack: "Slopsquatting" (2024)

Researchers at Lasso Security asked AI models to solve coding tasks and logged every package they recommended. They found that AI hallucinated over 20,000 unique package names that didn't exist. They then checked if any of these had been registered by attackers — and found dozens already had malware uploaded under those names on PyPI and npm.

🚨 Real Example: The "huggingface-cli" Attack

AI models frequently suggested pip install huggingface-cli — but the real package is called huggingface-hub. An attacker registered "huggingface-cli" and could have loaded it with malware. Any developer who followed the AI's suggestion would have installed a malicious package. This pattern was found for hundreds of popular packages where AI consistently suggests the wrong name.

The attack chain
# 1. AI hallucinates a package name Developer asks: "How do I parse YAML in Python?" AI says: pip install python-yaml-parser # DOESN'T EXIST! # 2. Attacker sees this hallucination is common (appears in 1000s of chats) # 3. Attacker creates the package on PyPI with malware inside # 4. Next developer follows AI advice: $ pip install python-yaml-parser # INSTALLS MALWARE! # The REAL package is just called "pyyaml" $ pip install pyyaml # ← This is the correct one # ALWAYS verify package names on pypi.org or npmjs.com before installing!
😴

Vibe Coding — The Competence Collapse

HIGH
🚨 Real Example: The 2024 Cloudflare Outage Pattern

Multiple companies reported production incidents caused by AI-generated code that "passed all tests" but failed in production. A common pattern: AI writes code that handles the happy path perfectly but fails on edge cases — high traffic, network timeouts, race conditions, or unusual input. One startup had a complete database corruption because AI-generated migration code didn't handle concurrent writes — a bug that wouldn't appear in testing but devastated production.

⚠️ The GitClear Data (2024)

GitClear analyzed 153 million lines of code across thousands of repositories and found that since AI coding tools became mainstream: code churn increased 39%, "moved" code (copy-paste) increased 17%, and code that was changed/deleted within 2 weeks of being written increased dramatically. Their conclusion: AI is generating more code, but much of it is lower quality and gets rewritten quickly.

🏴

THE MEGA RISK: AI + Closed Source = Invisible Danger

CRITICAL

This is the risk that should concern everyone the most. Think about what happens when AI generates millions of lines of closed-source code:

🚨 Scenario: The Bank

A major bank uses AI to generate its trading algorithm — 2 million lines of proprietary code. The AI introduces a subtle rounding error in currency conversion that only triggers for transactions above $10 million in specific currency pairs. No human fully reviewed all 2 million lines. The code is closed-source — no external audit is possible. Over 18 months, the error causes $47 million in losses before anyone notices. With open-source code, community reviewers would likely have caught the pattern.

🚨 Scenario: The Medical Device

An AI generates firmware for a closed-source medical insulin pump. The AI copies a pattern from its training data where an integer overflow occurs at exactly 256 units — wrapping to 0. The firmware passes standard tests (which test up to 100 units). In production, a patient programs 256 units → the pump delivers 0 → the patient goes into diabetic crisis. With open-source firmware, researchers could audit the code. With closed source, the bug remains invisible until someone is harmed.

🚨 Scenario: The Voting System

A government contractor uses AI to generate code for an electronic voting system. The AI, trained on millions of code examples, inadvertently introduces a race condition that under high load can occasionally count a vote twice or not at all. The system is proprietary — no public audit allowed. An election runs on it. Nobody can verify the results because nobody can see the code. This isn't hypothetical — proprietary voting machines have had exactly these kinds of undiscoverable bugs.

🔓 AI + Open Source

  • ✅ AI writes code → community reviews it
  • ✅ Thousands of eyes find AI's mistakes
  • ✅ Security scanners audit everything
  • ✅ Bugs are found and fixed publicly
  • ✅ Example: OpenSSL — bugs found and fixed by community in days

🔒 AI + Closed Source

  • ❌ AI writes code → nobody outside reviews it
  • ❌ Vulnerabilities hidden from the world
  • ❌ No external auditing possible
  • ❌ Bugs stay hidden for years until disaster
  • ❌ Example: Therac-25 — closed medical software killed patients because bugs were invisible
🔍

Security Scanners Can't Keep Up With AI Code

HIGH
🚨 Real Finding: Semgrep Research (2024)

Semgrep (the open-source code scanner) tested their rules against AI-generated code and found that AI writes vulnerabilities in patterns that existing rules don't catch. For example, AI might split a SQL injection across 3 lines with intermediate variables — technically the same vulnerability, but the scanner's pattern matching doesn't recognize it. Their team had to create 47 new rules specifically for AI-generated vulnerability patterns.

⚠️ The Arms Race

We're entering an era where: AI generates code → AI scans for bugs → AI generates code that evades the scanners → AI builds better scanners → repeat. Traditional human-authored scanning rules become less effective every month. The solution: use AI to scan AI-generated code, but ALSO maintain human code review. The combination of AI scanning + human review catches more than either alone.

Essential security scanning for AI-generated code
# Semgrep — catches AI-specific vulnerability patterns $ pip install semgrep $ semgrep --config=auto --config=p/security-audit . # Bandit — Python-specific security scanner $ pip install bandit && bandit -r ./src/ # Trivy — scans code + dependencies + containers $ trivy fs --security-checks vuln,secret,config ./ # Grype — scan dependencies for known CVEs $ grype dir:./my-project # USE AI TO SCAN AI: Ask a local model to review your code $ ollama run deepseek-coder-v2 "Find all security vulnerabilities in this code and explain each one: $(cat app.py)" # GOLDEN RULE: Run ALL of these on EVERY AI-generated code # before merging. Automate them in your CI/CD pipeline.
⚖️

License Violations & Legal Landmines

HIGH
🚨 Real Example: The Redis Incident

A developer used Copilot to implement a caching layer. Copilot generated code that was nearly identical to Redis's source code — which changed from BSD to a proprietary license (SSPL) in 2024. The developer unknowingly committed Redis's proprietary code into their company's codebase. When discovered during a license audit, the company had to rewrite the entire module — weeks of work and legal consultation costs.

⚠️ The Unsettled Legal Landscape

As of 2025: courts have NOT definitively ruled on whether AI training on open-source code violates copyright. The Butterick v. GitHub/Microsoft/OpenAI case is ongoing. The EU AI Act requires disclosure of training data. Japan ruled that AI training is generally legal. The US Copyright Office said AI-generated content may not be copyrightable. Different countries, different rules, complete uncertainty. Developers are caught in the middle.

🛡️ THE RESPONSIBLE PATH

7 Rules for AI-Assisted Development

1️⃣ Learn Fundamentals FIRST — AI Amplifies, Not Replaces

A developer who uses AI without understanding data structures, security basics, and system design is like someone using a power saw without knowing how to measure. The LinkedIn co-founder Reid Hoffman said it perfectly: "AI is a bicycle for the mind — but you still need to know where you're going."

2️⃣ Review EVERY Line — The 100% Rule

If you can't explain what a piece of code does, don't ship it. Period. Read every AI suggestion. Question why it chose that approach. Run it mentally. Check the edge cases. This takes more time than "vibe coding" — but it's the difference between a professional and a liability.

3️⃣ Use Open Source AI — Control Your Tools

Ollama + DeepSeek/Qwen + Continue.dev = zero cost, full privacy, no corporate dependency. Your code stays on your machine. You can audit the model. You're not feeding a corporation's training data. This is the ethical AND practical choice.

4️⃣ Scan EVERYTHING — Automate Security Checks

Run Semgrep, Bandit, Trivy, and Grype on ALL code. Automate them in CI/CD so no unscanned code ever reaches production. Use AI ITSELF as a security reviewer — ask a local model to audit your code for vulnerabilities before you commit.

5️⃣ Verify Every Dependency — Never Blind Install

When AI suggests a package: (1) Check if it exists on pypi.org/npmjs.com, (2) Check download counts (low = suspicious), (3) Check the GitHub repo (does it have stars? contributors? recent activity?), (4) Never install from a raw URL AI provides.

6️⃣ Human Review is MORE Important Now

Every PR needs human review — especially AI-generated code. The reviewer must understand what the code does, not just check if tests pass. AI can fool tests; it shouldn't fool a competent human reviewer.

7️⃣ Champion Open Source Transparency

Push for open source in every project. When AI generates code, the ONLY defense against hidden vulnerabilities is transparency. Closed-source AI-generated code is the biggest emerging security risk of our time. Open source = auditable = accountable.

«وَأَلَنَّا لَهُ الْحَدِيدَ • أَنِ اعْمَلْ سَابِغَاتٍ وَقَدِّرْ فِي السَّرْدِ»
"And We softened iron for him, [commanding], 'Make full coats of armor and calculate precisely the links.'" — Quran 34:10-11

Allah gave power (softened iron) but COMMANDED precision (وَقَدِّرْ فِي السَّرْدِ — "calculate precisely"). AI is our softened iron — incredible creative power. But Allah's command remains: be precise. Review. Verify. Test. Calculate every link in the chain. Power without precision is not just negligence — it's a betrayal of the trust we've been given.

🤖⚡🛡️

AI is a Tool, Not a Master

AI coding agents are the most powerful tools developers have ever had. They can make you 10x faster — or 10x more dangerous. The difference is: do you understand what you're shipping? Have you verified it? Have you scanned it? Have you thought about who it might hurt?

🧠
Learn First
🔍
Review Always
🔓
Open Source
🛡️
Scan Everything

«إِنَّا عَرَضْنَا الْأَمَانَةَ عَلَى السَّمَاوَاتِ وَالْأَرْضِ وَالْجِبَالِ فَأَبَيْنَ أَنْ يَحْمِلْنَهَا»

"We offered the trust to the heavens, earth, and mountains — they declined. Man undertook it." — Quran 33:72

AI is the newest Amanah. We accepted the burden of intelligence. Now we must carry it with wisdom, precision, and ethics. ✨