<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ketan Agarwal</title>
    <description>The latest articles on DEV Community by Ketan Agarwal (@ketan_agarwal_7cdae1b882d).</description>
    <link>https://dev.to/ketan_agarwal_7cdae1b882d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4219807%2F7d4a68f8-3502-4ed4-898e-e2c335c26df0.png</url>
      <title>DEV Community: Ketan Agarwal</title>
      <link>https://dev.to/ketan_agarwal_7cdae1b882d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ketan_agarwal_7cdae1b882d"/>
    <language>en</language>
    <item>
      <title>We Built pkgtruth at Hacktoberfest to Find What's Really Inside Python Packages</title>
      <dc:creator>Ketan Agarwal</dc:creator>
      <pubDate>Sun, 01 Nov 2026 00:47:37 +0000</pubDate>
      <link>https://dev.to/ketan_agarwal_7cdae1b882d/we-built-pkgtruth-at-hacktoberfest-to-find-whats-really-inside-python-packages-47oo</link>
      <guid>https://dev.to/ketan_agarwal_7cdae1b882d/we-built-pkgtruth-at-hacktoberfest-to-find-whats-really-inside-python-packages-47oo</guid>
      <description>&lt;p&gt;This is a submission for the &lt;a href="https://dev.to/mlh-hackathon"&gt;MLH x DEV Writing Challenge&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we install a Python library, we usually trust that the package contains the same code we see on GitHub.&lt;/p&gt;

&lt;p&gt;But what if it doesn't?&lt;/p&gt;

&lt;p&gt;That was the question behind our project at Hacktoberfest Hack Day 2026, hosted at Rishihood University, Sonipat.&lt;/p&gt;

&lt;p&gt;Our team, Commit-tee, worked on Problem Statement 4: Published Package vs Source Code Integrity Analyzer.&lt;/p&gt;

&lt;p&gt;We ended up building pkgtruth, a tool that helps developers understand what is actually inside a published Python package before they decide to trust it.&lt;/p&gt;

&lt;p&gt;The problem we wanted to solve&lt;/p&gt;

&lt;p&gt;Almost every developer uses open source libraries. A simple pip install can bring thousands of lines of code into a project.&lt;/p&gt;

&lt;p&gt;We might check the GitHub repository, read the documentation, or look at the source code. But the file we actually install is often a built package called a wheel.&lt;/p&gt;

&lt;p&gt;And the contents of that wheel may differ from the source code we reviewed.&lt;/p&gt;

&lt;p&gt;Some differences are completely normal. Packaging tools add metadata, and documentation or test files may be excluded.&lt;/p&gt;

&lt;p&gt;But other differences deserve attention.&lt;/p&gt;

&lt;p&gt;What if a published package contains an extra Python file? What if a startup script appears in the wheel but not in the source? What if a new release introduces network access or changes an entry point?&lt;/p&gt;

&lt;p&gt;Finding these differences manually can take time, especially when working with unfamiliar packages.&lt;/p&gt;

&lt;p&gt;We wanted to make that process easier.&lt;/p&gt;

&lt;p&gt;Introducing pkgtruth&lt;/p&gt;

&lt;p&gt;Our idea was simple:&lt;/p&gt;

&lt;p&gt;Don't just trust the package. Verify the release.&lt;/p&gt;

&lt;p&gt;pkgtruth compares a published Python package with selected source code and shows what changed.&lt;/p&gt;

&lt;p&gt;We built both a web interface and a command line tool, powered by the same Python analysis engine.&lt;/p&gt;

&lt;p&gt;It can help developers:&lt;/p&gt;

&lt;p&gt;Compare files using SHA-256 hashes.&lt;/p&gt;

&lt;p&gt;Identify added, removed, and modified files.&lt;/p&gt;

&lt;p&gt;Inspect wheel metadata and RECORD consistency.&lt;/p&gt;

&lt;p&gt;Detect potential execution surfaces such as .pth files.&lt;/p&gt;

&lt;p&gt;Examine security indicators, including network and subprocess capabilities.&lt;/p&gt;

&lt;p&gt;Compare two releases to understand what changed over time.&lt;/p&gt;

&lt;p&gt;Generate reports with supporting evidence.&lt;/p&gt;

&lt;p&gt;One decision was especially important to us: pkgtruth never needs to execute the package it is investigating.&lt;/p&gt;

&lt;p&gt;It inspects package contents statically instead of installing or running potentially suspicious code.&lt;/p&gt;

&lt;p&gt;Making security reports understandable&lt;/p&gt;

&lt;p&gt;Finding a difference is only half the problem. Explaining it clearly is just as important.&lt;/p&gt;

&lt;p&gt;During development, we realized that a report full of hashes, file paths, and technical labels wouldn't be very useful to someone who was new to software security.&lt;/p&gt;

&lt;p&gt;So we worked on making the reports easier to read.&lt;/p&gt;

&lt;p&gt;Instead of only displaying raw findings, pkgtruth starts with a short summary explaining what deserves attention and why.&lt;/p&gt;

&lt;p&gt;Developers can still inspect the detailed evidence, file differences, and hashes when needed.&lt;/p&gt;

&lt;p&gt;We also added three features that became important parts of the project.&lt;/p&gt;

&lt;p&gt;Release DNA helps compare package releases and identify newly observed changes.&lt;/p&gt;

&lt;p&gt;Proof Capsule creates a portable report containing findings, hashes, and the limitations of the analysis.&lt;/p&gt;

&lt;p&gt;Release Gate applies configurable rules and returns an ALLOW, REVIEW, or BLOCK recommendation.&lt;/p&gt;

&lt;p&gt;These are recommendations based on the available evidence, not guarantees that a package is safe.&lt;/p&gt;

&lt;p&gt;We also experimented with local AI&lt;/p&gt;

&lt;p&gt;We wanted to explore how AI could help someone understand security findings without replacing the actual analysis.&lt;/p&gt;

&lt;p&gt;For this, we integrated Qwen 3.5 4B through Ollama, running locally.&lt;/p&gt;

&lt;p&gt;The analysis engine first identifies the evidence. The language model then helps explain selected findings in simpler terms.&lt;/p&gt;

&lt;p&gt;The important distinction is that AI doesn't decide whether a package is safe. It doesn't change the file hashes, security findings, or policy decisions.&lt;/p&gt;

&lt;p&gt;Its job is to help people understand the results.&lt;/p&gt;

&lt;p&gt;We liked this approach because the underlying checks remain deterministic, while the explanations become easier to follow.&lt;/p&gt;

&lt;p&gt;The part that taught us the most&lt;/p&gt;

&lt;p&gt;Building the features was only one part of the challenge. Getting everything to work together took a lot of debugging.&lt;/p&gt;

&lt;p&gt;We worked on the analysis engine, web interface, CLI, package installation, security checks, and automated tests.&lt;/p&gt;

&lt;p&gt;One interesting moment came near the end.&lt;/p&gt;

&lt;p&gt;Our local test suite had 216 passing tests, but our GitHub pull request still failed CI.&lt;/p&gt;

&lt;p&gt;The problem wasn't the scanner itself. Some example reports were generated using an older version of our output format. After updating the code, we had forgotten to regenerate those examples.&lt;/p&gt;

&lt;p&gt;We fixed the mismatch, committed the updated files, and ran CI again.&lt;/p&gt;

&lt;p&gt;This time it passed.&lt;/p&gt;

&lt;p&gt;It was a useful reminder that passing local tests doesn't always mean a project is ready. Packaging, reproducible outputs, and continuous integration matter too.&lt;/p&gt;

&lt;p&gt;One thing we learned about security&lt;/p&gt;

&lt;p&gt;A security tool should be clear about what it knows and what it doesn't.&lt;/p&gt;

&lt;p&gt;For example, a valid wheel RECORD file shows internal consistency. It doesn't prove that the publisher is trustworthy.&lt;/p&gt;

&lt;p&gt;Similarly, detecting a suspicious import doesn't prove that the code was executed or that a package is malicious.&lt;/p&gt;

&lt;p&gt;We tried to preserve these distinctions throughout pkgtruth.&lt;/p&gt;

&lt;p&gt;Sometimes the correct answer is simply that more investigation is needed.&lt;/p&gt;

&lt;p&gt;What's next?&lt;/p&gt;

&lt;p&gt;pkgtruth is still a project with plenty of room to grow.&lt;/p&gt;

&lt;p&gt;We would like to expand support for more package ecosystems, improve release monitoring, and make investigations even easier for developers.&lt;/p&gt;

&lt;p&gt;For now, we're happy that we managed to turn a hackathon problem statement into a working tool with a web interface, CLI, local AI assistance, automated tests, and a complete GitHub workflow.&lt;/p&gt;

&lt;p&gt;More importantly, we learned a lot about Python packaging, software supply chain security, and what it takes to build a project beyond a simple prototype.&lt;/p&gt;

&lt;p&gt;A big thank you to Hacktoberfest, Rishihood University, Newton School of Technology, and everyone who helped make the event possible.&lt;/p&gt;

&lt;p&gt;And of course, to our team Commit-tee for building this together.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/k3tan7/pkgtruth" rel="noopener noreferrer"&gt;https://github.com/k3tan7/pkgtruth&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Final thought: The code you review and the package you install are not always the same thing. It's worth checking the difference.&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>mlh</category>
      <category>opensource</category>
      <category>devchallenge</category>
    </item>
  </channel>
</rss>
