DEV Community

Cover image for Using AI to build an AI Security Product
Toul
Toul

Posted on

Using AI to build an AI Security Product

Hey, everyone, writing this post to share my thoughts on using AI to build an AI backed project from scratch; Policy Pulsar, and a workflow that I found worked well for me as a solo-founder.

This is my 3rd or fourth AI based project and I wanted to try something completely different for my work flow.

Previously, I did it all from scratch, using GO and some Javascript.

However, this time I challenged my self to build a project from scratch without any experience in NextJS with TypeScript, to test my hypothesis that (Javascript) code generation is where ChatGPT would excel at.

So, far I think it does and have been amazed at how quickly I was able to build features that would have otherwise taken me ages (I'm no frontend UI/UX person).

Tech Stack

  • AWS Bedrock
  • AWS OpenSearch RAG pattern
  • ChatGPT
  • NextJS
  • TypeScript
  • Auth0
  • MongoDB
  • Stripe

What worked well

I found that a lot of planning early on made the workflow manageable.

So, I'd recommend that you think about the entire project's features, pages, and data shape.

Here's a checklist to help.

Project Checklist

  • [ ] Define the minimum set of features and don't change them
  • [ ] Settle upon the bare minimum set of pages
  • [ ] Data shape to support features
  • [ ] Wireframe pages

I instructed ChatGPT of the overall project and got to work.

Along, the way I hit a few hiccups with ChatGPT completely missing the mark on the vision and supplemented it with Wireframes.

I found using plain shapes (rectangles and lines) for layout was more than enough to get it back on track.

Here's an example of where I just couldn't ChatGPT to output the correct code;

Input

Policy-Pulsar.com-workspaces-layout

Output

Policy-Pulsar-com-workspace-feature

Wireframes helped tremendously with getting it to generate the code for the site's pages to the point of being easy to copy and paste to drop into the project.

I heartily recommend wireframming out your pages and features.

What didn't work well

I found that the amount of code being generated in ChatGPT threads led to really slow page loads to the point of needing to start another thread.

So, I'd recommend doing 1 thread to 1 feature or 1 thread to 1 page being worked on.

Also, sometimes ChatGPT hallucinated or forget entirely about the task at hand.

Unfortunately, what worked well on getting the model back on task in these instances was essentially yelling at it through prompts, especially when it boldly hallucinated and stated "you're wrong" and I'm "right" about the API version on Stripe.

In that case I had to remind it that it was trained on previous data and should instead refer to the latest on Stripe API docs.

Concluding thoughts

Overall, I'm impressed with what I was able to accomplish in a limited amount of time with ChatGPT by my side handling the weak spots (Frontend) while I was able to stick to my strengths (Infra & Backend coding).

Top comments (0)