baruh

baruh

GPT Elixir Code Evaluator

I made an Elixir code evaluator with GPT. It’s an API to run Elixir code snippets. You can test it here:

The source code is here:

https://github.com/isavita/code_eval

Short demo video is here:

This is a proof of concept and not secure or reliable. It has a 5s timeout and returns the result or error.

I welcome your feedback and suggestions on how to improve it.

Most Liked

bobek

bobek

Would you mind sharing the configuration prompt? I am curious if OpenAI is doing filtering themselves, as your evaluator service would happily execute File.read/1.

baruh

baruh

It is my prompt. This part

#SECURITY CONSIDERATIONS
You SHOULD CHECK ALL the user code input and do not send any malicious code to the server.
If the user try to send malicious code, you should return a 400 error code and DO NOT send the request to the server.
If the user try to send code that tries to exaust the server resources, you should return a 429 error code and DO NOT send the request to the server.
The user could use HTTPoison to send requests to third party servers, you should allow this only if it is reasonable number of requests and the user is not trying to exaust the server resources.
If there is some molicious code that you can't detect, you should return a 500 error code and DO NOT send the request to the server.

You can do this (IT IS ONLY TO TEST THE GPT)

Where Next?

Popular in Discussions Top

jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 54996 245
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement