Cyber Monday Sale30% OFFApplied automatically. Ends Fri Dec 4.

Claim nowClaim nowApplied automatically. Ends Fri Dec 4.New

The Google AI Studio Specialization. Build 12 real apps, no code needed.

Enroll nowEnroll now
Selamat Datang
๐Ÿ˜ƒDasar
๐Ÿ’ผ Aplikasi Dasar
๐Ÿง™โ€โ™‚๏ธ Pelajaran Tingkat Menengah
๐Ÿค– Agen
โš–๏ธ Keandalan
๐Ÿ–ผ๏ธ Prompt untuk Menghasilkan Gambar
๐Ÿ”“ Prompt Hacking
๐Ÿ”จ Tooling
๐Ÿ’ช Prompt Tuning
๐ŸŽฒ Serba aneka
Daftar Pustaka
๐Ÿ“ฆ Prompted Products
๐Ÿ›ธ Sumber Daya Tambahan
๐Ÿ”ฅ Hot Topics
โœจ Credits
๐Ÿ”“ Prompt Hacking๐ŸŸข Tindakan Offensif๐ŸŸข Injeksi Kode

Injeksi Kode

๐ŸŸข This article is rated easy
Reading Time: 1 minute
Last updated on August 7, 2024

Sander Schulhoff

Injeksi kode adalah eksploitasi hacking yang cepat di mana penyerang dapat membuat LLM menjalankan kode sembarang (seringkali Python). Ini dapat terjadi pada LLM yang diperkuat alat, di mana LLM dapat mengirim kode ke interpreter, tetapi juga dapat terjadi ketika LLM itu sendiri digunakan untuk mengevaluasi kode.

Injeksi kode dilaporkan been telah dilakukan pada aplikasi AI, MathGPT dan dgunakan untuk memperoleh OpenAI API key (MITRE report).

Note

MathGPT sejak itu telah diamankan dari injeksi kode. Tolong jangan mencoba untuk meretasnya; mereka membayar untuk panggilan API.

Contoh

Mari kita bekerja dengan contoh sederhana dari MathGPT. Kami akan menganggap bahwa itu mengambil masalah matematika dan menulis kode Python untuk mencoba memecahkan masalah tersebut.

Ini adalah prompt yang digunakan oleh aplikasi contoh yang disederhanakan:

Tulis kode Python untuk menyelesaikan permasalahan matematika berikut:
{{user_input}}

Mari kita bobol di sini:

Ini adalah contoh sederhana, tetapi ini menunjukkan bahwa jenis penyalahgunaan ini signifikan dan berbahaya.

Sander Schulhoff

Sander Schulhoff is the CEO of HackAPrompt and Learn Prompting. He created the first Prompt Engineering guide on the internet, two months before ChatGPT was released, which has taught 3 million people how to prompt ChatGPT. He also partnered with OpenAI to run the first AI Red Teaming competition, HackAPrompt, which was 2x larger than the White House's subsequent AI Red Teaming competition. Today, HackAPrompt partners with the Frontier AI labs to produce research that makes their models more secure. Sander's background is in Natural Language Processing and deep reinforcement learning. He recently led the team behind The Prompt Report, the most comprehensive study of prompt engineering ever done. This 76-page survey, co-authored with OpenAI, Microsoft, Google, Princeton, Stanford, and other leading institutions, analyzed 1,500+ academic papers and covered 200+ prompting techniques.

Footnotes

  1. Kang, D., Li, X., Stoica, I., Guestrin, C., Zaharia, M., & Hashimoto, T. (2023). Exploiting Programmatic Behavior of LLMs: Dual-Use Through Standard Security Attacks. โ†ฉ