DEV Community

Hansica Venkatayogi
Hansica Venkatayogi

Posted on

Secure Push

What if git push wasn't the last step?

For most developers, the flow is pretty simple.

Write code.

Test it.

Run:

git push
Enter fullscreen mode Exit fullscreen mode

And the code is on its way.

But what if the code had a security check before it was allowed to leave your machine?

That was the idea behind SecurePush, the project we built for HackWith Hyderabad 3.0.

Making security part of the Git workflow

We didn't want developers to open another tool every time they wanted to check their code.

We wanted the security check to happen where developers already work.

So SecurePush works around the normal Git push workflow.

You make your changes and run:

git push
Enter fullscreen mode Exit fullscreen mode

SecurePush checks the changed code before allowing the push to continue.

If it finds a security issue, it explains what it found and suggests a possible fix.

The developer is still in control.

They can accept the fix or reject it.

If the fix is accepted, SecurePush applies it and runs verification.

If everything passes, the push continues.

If the problem isn't resolved, the push can be blocked.

That gives us a simple flow:

Code → Scan → Fix → Verify → Push

But we didn't stop there.

Giving the security check a memory

One thing felt missing from a normal security review.

History.

Suppose SecurePush finds a hardcoded credential today.

The developer accepts the suggested fix.

The fix works.

The tests pass.

The push goes through.

What happens tomorrow?

Without memory, the next review has very little context about that previous interaction.

So we added Hindsight.

Hindsight allows SecurePush to retain useful information from previous security reviews and recall it later.

It remembers things such as:

  • the security issue that was found
  • the file involved
  • the severity
  • the suggested remediation
  • whether the developer accepted or rejected it
  • whether verification passed or failed
  • whether the push was allowed or blocked

The important thing is that we are not storing the actual secret if the issue involves a credential.

We want the security context, not the sensitive value.

A simple example

Imagine the first review finds:

Hardcoded credential in src/config.ts

SecurePush suggests moving it to an environment variable.

The developer accepts it.

The fix is applied.

Verification passes.

That outcome is retained in Hindsight.

Later, another change touches the same area.

Before reviewing the new change, SecurePush can recall relevant information from the previous review.

Now the security agent has some context about what happened before.

But it still checks the current code.

That's important.

Memory is there to provide context, not to blindly decide that the current code is safe or unsafe.

We wanted developers to see that memory

Another thing we cared about was making the memory visible.

It would be easy to connect Hindsight in the backend and simply say:

"Our project has memory."

But that doesn't really show anything.

So we added a Memory section where developers can see the security information that has been retained for the repository.

This makes the flow much easier to understand.

You can see what happened during previous reviews and what SecurePush can use during future ones.

The full SecurePush flow

After putting everything together, the workflow looks like this:

1. Make a code change

↓

2. Run git push

↓

3. SecurePush scans the changed code

↓

4. Previous security memory is recalled

↓

5. Security issue is identified

↓

6. A fix is suggested

↓

7. Developer accepts or rejects it

↓

8. SecurePush verifies the result

↓

9. Push is allowed or blocked

↓

10. The outcome is remembered

The next review can then use that history.

So the process doesn't really end when the push is complete.

The result becomes part of the repository's security memory.

The part we enjoyed building

The Git integration was obviously an important part of the project.

But the part that stood out to us was the combination of security + memory.

A security tool normally answers a question about the code in front of it.

SecurePush can also bring some context from previous reviews into that process.

That changes the way we think about an AI security tool.

It doesn't need to remember everything.

It just needs to remember the information that can actually help with the next review.

What we took away

Building SecurePush made us think about something beyond this particular project.

AI tools are becoming good at generating answers.

But sometimes the more useful question is:

What should the system remember after giving that answer?

For SecurePush, the answer was security findings, developer decisions, fixes, and verification outcomes.

That information can become useful the next time the repository is reviewed.

And that's what we wanted to build.

A security gate that sits in the Git workflow, checks your code before it gets pushed, and remembers what happened along the way.

**SecurePush doesn't just check the next push.

It carries some of the previous ones with it.**

Top comments (0)