openai / openai-cookbook

Examples and guides for using the OpenAI API
https://cookbook.openai.com
MIT License
58.41k stars 9.26k forks source link

[FEATURE] New notebook for detecting python code vulnerabilities using GPT4 #1100

Open mhbuehler opened 5 months ago

mhbuehler commented 5 months ago

Is there any interest in a notebook contribution that demonstrates a few ways of prompting GPT4 to detect insecure code snippets? The solution would include prompt templates that use techniques like few-shot learning, KNN-based few-shot learning (from this paper), and asking for a code fix (proposed by this paper) to increase prediction accuracy.

Is your feature request related to a problem? Please describe. This is a proposal for a new use case. It would help users who are looking for examples that:

Describe the solution you'd like I've written a draft notebook based on my experiments and would be happy to submit a PR. I'm an experienced software engineer and have recently been applying AI to topics in software security.

Additional context There would be a new data file based on the published dataset from this paper which has this license. The notebook would cite all sources and include some evaluation metrics. Thanks for your consideration.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

mhbuehler commented 3 months ago

Commenting so this issue stays open. Can maintainers take a look at the notebook in https://github.com/openai/openai-cookbook/pull/1112 and let me know if it can be merged or not? Thank you.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

mhbuehler commented 1 month ago

Commenting to remove the stale label