WhoBuilt

Enhancing Quality and Security in CI

Nov 27, 2024· 18 min· 2.2K views·Watch on YouTube

Speaker

Gunjan Patel, director of engineering at Palo Alto Networks, presents a side project on using AI in CI to improve code quality and security at a conference.

Move repetitive work into CI

Patel describes how developers move between flow, anxiety, and boredom as they write code, tackle hard problems, and handle tasks like tests and documentation. Since coding is only one part of software development, he proposes using CI to take on some of the slower, repetitive work.

Give AI time to review deliberately

Patel contrasts IDE copilots, which need to respond quickly, with code review, which benefits from time and iteration. His proposed “Ghost Pilot” runs during the pull request process, where it can improve names and comments, develop tests, identify security concerns, and suggest fixes for human review.

Build tests from intent and history

Patel says clearer names and comments help AI infer what code is meant to do; for example, `annualRevenue` conveys more than `rev`. His test workflow first establishes expected behavior using code, comments, README files, and possibly a product requirements document, then lists adversarial edge cases and adds cases informed by team priorities and historic bugs before generating tests.

Use application context to assess security

Patel's context includes deployment details, data sensitivity, application type, product requirements, past bug reports, and security policies. He proposes having a red team engineer, a Python developer, and an engineering manager review code from different perspectives, debate the risks and effort, and check whether findings match the original intent. He says this approach found a critical logical flaw in Kubernetes Go code.

Keep people in control of fixes

For each proposed security fix, the system would explain its priority, summarize the discussion, and cite the relevant security policy. Patel says to run the tests before human review so reviewers can assess the proposed changes with a passing test baseline; a person decides which fixes to make.

Takeaways

  • Use CI for slower review tasks that do not need an IDE copilot's instant response.
  • Give AI explicit code intent through clear variable names, comments, and project documentation.
  • Generate tests in stages: infer expected behavior, enumerate edge cases, add project-specific history, then write and run the tests.
  • Include deployment, data, product, and security policy context when asking AI to assess application risks.
  • Present prioritized fixes with reasoning and test results, while leaving the final decision to a human reviewer.

Mentioned in this talk

Search inside this talk

What was claimed 6

  • works at
    Director of Engineering, Office of the Chief Product Officer
    “I'm a director of engineering at Palo Alto Networks.”
    YouTube
    Verified3 sources· Talk, Web· archived
  • feature
    Ghost Pilot: Uses CI to iteratively improve code context, generate unit tests, identify security issues, and propose fixes for human review
    “The key part of this talk is about outsourcing a boring task to CI.”
    YouTube
    Unverified1 source· Talk
  • feature
    Ghost Pilot: Generates tests in stages using expected behavior, adversarial edge cases, and project-specific context
    “Then personalize the code... it will add a few more unit tests... Then the last step is... Generate the unit tests.”
    YouTube
    Unverified1 source· Talk
  • feature
    Ghost Pilot: Simulates a red team engineer, Python developer, and engineering manager debating security issues and prioritization
    “I'm doing here is simulating three AI employees.”
    YouTube
    Unverified1 source· Talk
  • feature
    Ghost Pilot: Presents suggested security fixes and rationale for a human reviewer
    “A human reviewer comes in at the end and decides which ones to actually fix.”
    YouTube
    Unverified1 source· Talk
  • uses
    “This is my information; this is the GitHub repo.”
    YouTube
    Unverified1 source· Talk

Related talks